0

I have installed node using sudo apt-get install node.

linux@linux:~$ node -v
linux@linux:~$

linux@linux:~$ npm -v
1.3.10
linux@linux:~$ 

I also download node from https://nodejs.org/en/ but, I don't find the full installation manual.

5
  • nodejs.org/en/docs/guides
    – user772253
    May 19, 2018 at 4:51
  • @VladSpirin where the installation guide? your provided guide is started with How do I start with Node.js after I installed it?
    – alhelal
    May 19, 2018 at 4:56
  • tecadmin.net/install-latest-nodejs-npm-on-ubuntu
    – user772253
    May 19, 2018 at 5:38
  • You didn't install it. Try sudo apt-get install nodejs
    – user772253
    May 19, 2018 at 5:45
  • @VladSpirin this add nothing.
    – alhelal
    May 19, 2018 at 13:58

1 Answer 1

2

The Node.js executable is installed to /usr/bin/nodejs and the command to show the Node.js version is:

nodejs -v  

Instead of installing the Node.js apt package with sudo apt install nodejs I recommend installing the more up-to-date Node.js snap package with sudo snap install node by following the instructions in this answer.

5
  • @SurajRao node -v is the command for showing the Node.js version for the Node.js snap package. For showing the Node.js apt package version see this answer: askubuntu.com/questions/594656/…
    – karel
    May 19, 2018 at 5:54
  • Yeah . You are right.. actually askubuntu.com/questions/404929/node-command-not-found explains it... Sorry.. Ubuntu has some package name issue
    – Suraj Rao
    May 19, 2018 at 5:56
  • The reason for this discrepancy is that it is possible to install the Node.js snap package and the Node.js apt package alongside each other, and still be able to check the versions of each package in an unambiguous way. btw Your duplicate comment below the question is correct. The question is a legitimate duplicate of How to install the latest versions of NodeJS and NPM?
    – karel
    May 19, 2018 at 6:02
  • that makes sense.. But for people who want to maintain multiple node installations, it is recommended to use nvm.
    – Suraj Rao
    May 19, 2018 at 6:04
  • nvm is now unnecessary if the Node.js snap package is installed. Users can switch between versions of Node.js at any time without needing to involve additional tools like nvm (Node Version Manager), for example: sudo snap refresh node --channel=8/stable It's a great feature, you can have multiple Node.js versions installed alongside each other with the Node.js snap package, and select which version of Node.js to use for each project.
    – karel
    May 19, 2018 at 6:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.