3

After installing node via npm , using 'nvm ls' gives the version which i have installed like v8.9.4 and also node -v also shows the version. But at the same time, when checking for 'nodejs --version' tells me to install node js as 'sudo apt-get install nodejs'.

Addictd
  • 57
  • 1
  • 12
  • Check this answer: https://askubuntu.com/questions/794822/node-vs-nodejs-on-ubuntu-package-manager – Daniel Jan 30 '18 at 04:21
  • Does this answer your question? [What are the differences between node.js and node?](https://stackoverflow.com/questions/20057790/what-are-the-differences-between-node-js-and-node) – Ryan Apr 26 '20 at 21:36

1 Answers1

4

Via npm or nvm Node.js is called node but if you install via apt-get you need to use the package name nodejs because via apt-get node is a package name take by a completely different application that happens to also be called node.

what are the differences between node.js and node?

Usman Mutawakil
  • 4,993
  • 9
  • 43
  • 80
  • Right now I have installed both via NVM and via 'sudo apt-get install nodejs' – Addictd Jan 30 '18 at 04:17
  • Will their be any issue in future? – Addictd Jan 30 '18 at 04:17
  • I would remove one. Its easier to track your version when you know which one is being ran because theres only one. The issue I run into when I have multiple versions of node is when something tries calling node and uses the wrong one so for me I only use one. – Usman Mutawakil Jan 30 '18 at 04:28