I installed nodejs on ubuntu from instructions given here
When I write node --version
in the terminal I see this :
-bash: /usr/sbin/node: No
If you like to install multiple nodejs versions and easily switch between them, I would suggest using Node Version Manger. It also solves the naming problem (node
vs nodejs
)
It's quite simple:
Install a nodejs version:
$ nvm install 4.4
Now you have nodejs 4.4 in addition to the version that was already installed and you can just use the node
command to reach the newly installed version:
$ node -v // The new version added by nvm.
v4.4.5
$ nodejs -v // The OS version is untouched and still available.
v0.10.25
You can install more nodejs versions and easily switch between them:
$ nvm install 6.2
$ nvm use 6.2
Now using node v6.2.1 (npm v3.9.3)
$ node -v
v6.2.1
$ nvm use 4.4
Now using node v4.4.5 (npm v2.15.5)