What are the differences between node.js and node?

I installed node.js on my computer (linux mint 15), when I run node example.js it says:

 The program 'node' can be found in the following packages: * node * nodejs-legacy Try: sudo apt-get install <selected package> 

So what are the differences between node and nodejs? I had both node.js and node installed earlier, but when I run node example.js , the web server does not start at all. So I deleted node and saved node.js.

+82
apt apt-get linuxmint
Nov 18 '13 at 20:59
source share
2 answers

The node package is not related to node.js.

nodejs is what you want, however it might be better if the command is called node for compatibility with scripts using #!/usr/bin/env node .

You can either create a symbolic link in your path:

 sudo ln -s `which nodejs` /usr/local/bin/node 

Or you could install nvm and then use it to install the latest version of node.js:

 nvm install stable 

I prefer the nvm method as it allows you to sudo apt-get remove nodejs and then manage the version of node you are using yourself. You can also install multiple versions of node.js and use nvm use to easily switch between them.

I also like to add the line at the bottom of my .bashrc as: nvm use stable > /dev/null . This automatically uses the latest version that you installed.

To upgrade the node version to the latest stable version: nvm install stable . Each time you do this, you will need to install all the npm packages that you have installed globally if you want to continue using them.

To upgrade to the old version, simply run nvm use <version> or, if you do not already have the old version installed: nvm install <version> .

+127
Nov 18 '13 at 9:12
source share

This answer is just to tell you the difference between node and nodejs packages on debian OS.

node

nodejs

  • Node.js is a JavaScript-based runtime platform for quickly creating fast, scalable network applications. Node.js uses an event-driven, non-blocking I / O model that makes it lightweight and efficient, ideal for real-time data intensive applications that work across distributed devices.
  • Link to package information:
+11
Oct 23 '16 at 11:37
source share



All Articles