Leongaban
By:
Leongaban

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

January 15, 2015 5.9k views

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?

3 Answers

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?

  • Hi! Are you able to run nodejs -v? If so, can you please post the output of which nodejs?

Yes. But I created a new droplet and after it the mentioned code for linking node to nodejs helped me. Thanks.

Have another answer? Share your knowledge.