Strange npm behavior when installing packages like grunt

2.4k views Asked by At

I run the following command in my bash and I get the related results:

merianos@merianos-desktop:~$ sudo npm install -g grunt-cli
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
[email protected] /usr/local/lib/node_modules/grunt-cli
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])

and

merianos@merianos-desktop:~$ grunt
/usr/bin/env: node: No such file or directory

I also have try to install bower and gulp but again, when I try to execute them, I get a message related to the grunt above.

Can someone please help me ?

Just to know, I just installed Ubuntu 15.04. I don't know if that helps :)

1

There are 1 answers

1
vanadium23 On BEST ANSWER

Ubuntu package nodejs provide a binary as a /usr/bin/nodejs, not a /usr/bin/node, so most of cli tools can't find it. To solve the problem you need to make a symlink:

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