0

I downloaded NodeJS what I thought was the normal way, but for some reason after installing it on my linux machine, the nodeJS program is called "nodejs" rather than "node". This is problematic because every module I get from NPM uses "node" to run their scripts on. So I have been having to go in and manually change the files to use "nodejs" instead. This is very annoying and I would like to change it so my machine uses just "node" now. What is the best way of doing this? Thanks

Matt Hintzke
  • 7,744
  • 16
  • 55
  • 113
  • Did you use any of the methods covered in my answer [here](http://stackoverflow.com/questions/13845321/should-i-install-node-js-on-ubuntu-using-package-manager-or-from-source/) to install? You really need `node` to be `node` and not `nodejs`. My gut reaction is that it's installed wrong. If you think it is installed right, you can try just adding a symlink from `nodejs` to `node`. That leaves me with an icky feeling but it may fix your problem. – David Weldon Feb 05 '13 at 01:06
  • I installed it using sudo apt-get install nodejs i believe. was it because I denoted "nodejs" instead of "node"? – Matt Hintzke Feb 05 '13 at 01:12
  • Huh, well that's awful. Are you using ubuntu? If so, the package name is `nodejs`, however you should follow the directions from the above answer and not use the default universe packages. You can still install using apt, but you should use the directions [here](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager). I'm going to assume they properly call the binary to `node` and not `nodejs`. – David Weldon Feb 05 '13 at 01:39

1 Answers1

1

Create a symlink as below:

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

That should do it.

almypal
  • 6,612
  • 4
  • 25
  • 25