I want to find where is my node.js in ubuntu linux system, the command: which node gives me the path of /usr/bin/node, but when I go to that folder, there i
don't worry sudo apt-get install nodejs
installs a version of nodejs which is normally outdated. /usr/bin/nodejs
is therefore fine.
Do some additional work to use only node
for the command line:
install package manager npm: sudo apt-get install npm
then upgrade npm: sudo npm cache clear --force && sudo npm install -g npm
next install n: sudo npm install -g n
which is a version manager for node.
after this upgrade your node installation: sudo n stable
this will create a /usr/bin/node
script which fixes your described issue so you can use node app.js
to execute your app instead of nodejs app.js
.
You can downgrade node to a desired version, e.g: sudo n 0.12.4
check your version to verify: node --version