1

I have the latest stable node.js. It works, npm works, nvc works.

When I try to install grunt I install grunt-cli, I install grunt in a local folder and after typing grunt or grunt --version or grunt -h etc I get this:

$ grunt --version 
/usr/bin/env: node: No such file or directory

I tried adding path but since I am new to Linux I might have done it wrong.

This is the report from installing 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])

feel free to talk to me like you would talk to a child... thanks!

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Zanna
  • 69,223
  • 56
  • 216
  • 327
Bellator
  • 23
  • 6

1 Answers1

3

Y'know what, my last comment was pretty snarky. Apologies.

You have node.js installed, except the binary is called nodejs and grunt is assuming it's node.

There's a built-in way to create aliases to programs: update-alternatives

sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10

After that, grunt should be able to find node that points to nodejs

glenn jackman
  • 17,625
  • 2
  • 37
  • 60