I cannot find grunt
, though I just installed it via package.json
My setup:
ph@vm:~$ uname -a
Linux vm 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
ph@vm:~$ which node
/usr/bin/node
ph@vm:~$ which npm
/usr/bin/npm
ph@vm:~$ node -v
v4.4.3
ph@vm:~$ npm -v
3.8.6
ph@vm:~$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
NODE_ENV="development"
#NODE_PATH=/usr/local/lib/node_modules
NODE_PATH=/usr/lib/nodejs:/usr/local/lib/node_modules:/usr/share/javascript
My package.json
{
...
"scripts": {
....
"pretest": "grunt lint",
"test": "karma start test/karma.conf.js",
...
"protractor": "protractor e2e-tests/protractor.conf.js",
},
"dependencies": {
....
"grunt": "^0.4.5",
...
},
"devDependencies": {
...
"karma": "~0.12.37",
....
"protractor": "~2.5.1",
...
}
}
Problem
After a npm install
in the folder of package.json
all the required packages are installed correctly in node_modules
.
Running:
npm run protractor
=> works fine
npm run pretest
= fails:
AND
npm run test
=> fails:
WITH
> grunt lint
sh: 1: grunt: not found
What's wrong with my setup?