Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i installed nodejs with apt-get on 14.04

When i do nodejs -v


and when i do node -v

node : command not found.

So i want to make alias of nodejs as node

So i inserted a line in ~/.bashrc

alias node=nodejs

Now i can access the nodejs with node on terminal.

But in my project, i use grunt which fires nodemon via gruntfile.js. Now nodemon tries to run node instead of nodejs

Now again i get the same problem node : command not found.

Means alias was not made for non-interactive shell non-login shell.

Where should i make the alias for this specific purpose and get my problem solved?

share|improve this question
Please add the same alias in /etc/profile and restart; after changing any rc file or profile file you must source it. – PradyJord Jun 6 '14 at 9:27
@Jord i edited /etc/profile with same alias and restarted. But still the problem is same. – nodeofcode Jun 6 '14 at 9:51

Well curiously, I have a node. It's an alternatives system symlink and I'm not quite sure how I got it (in a way that you don't). It was a while since I installed it so perhaps I followed this SO post or one like it... Who knows!

You could just write a little bash alias but that'll only work for one user at a time. It might just make more sense to add it as as symlink globally. I'm not sure there's any value going through the alternatives system so we can just plonk one in /usr/local/bin (this is where non-package-managed binaries should go):

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

Edit: That SO post I talked about actually links back to one of ours which might be relevant. It suggests installing nodejs-legacy is the way forward.

share|improve this answer
Find the location of nodejs via whereis nodejs then do ln -s /usr/bin/nodejs ~/bin/node (yes, no sudo there); replace /usr/bin/nodejs with the path your nodejs is at – srcspider Apr 27 '15 at 11:13
going backwards is not the way forward – srcspider Apr 27 '15 at 11:14

Recently fixed this using nodejs-legacy.

Run the following command:

sudo apt-get install nodejs-legacy

This should fix it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.