Question

Node installed, but can't get version or run Node

Hi all! So pretty new to DigitalOcean, and am wanting to get the MEAN stack tools installed on my droplet.

I got npm installed easily and can get npm -v However node -v and node didn’t work.

So I followed the instructions here: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server

Followed these steps:

    sudo apt-get update
    sudo apt-get install nodejs

And got the follow:

root@Bitage:~# sudo apt-get install nodejs

Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version.
nodejs set to manually installed.
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-36 linux-headers-3.13.0-36-generic
  linux-image-3.13.0-36-generic linux-image-extra-3.13.0-36-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 70 not upgraded.

root@Bitage:~# sudo apt-get install npm

Reading package lists... Done
Building dependency tree
Reading state information... Done
npm is already the newest version.
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-36 linux-headers-3.13.0-36-generic
  linux-image-3.13.0-36-generic linux-image-extra-3.13.0-36-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 70 not upgraded.

root@Bitage:~# node -v
root@Bitage:~# node
root@Bitage:~#

I’m still not getting the node version, and also typing node doesn’t open the REPL?

What am I doing wrong?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

The nodejs package installs node as nodejs, so running nodejs -v should work. If you’re not planning on install the node package which is completely unrelated to NodeJS, you can link node to nodejs:

sudo ln -s /usr/bin/nodejs /usr/bin/node

You should then be able to use node as well as nodejs.

Hi! I have the same problem, but linking node to nodejs as mentioned above didn’t help me. Any idea?

I recognize now I jumped the gun on recommending n as it has some issues in shared node_modules across versions (uninstalling is also painful). I’ve since tried n, nodenv, nvm & nave for managing versions and nodenv is the best while nvm and nave are worth considering. You can review my article for using nodenv to manage virtual environments in development. I’m going to next write one for using nodenv in facilitation production deployments but perhaps in the interim this can provide some inspiration.