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> .
Paulpro Nov 18 '13 at 9:12 2013-11-18 21:12
source share