Viene visualizzato un errore strano dopo l'esecuzione di npm run-script grunt
in cui mi risulta che node_modules/.bin/grunt
non riesce.Perché Grunt fallisce?
Sto seguendo un tutorial come im abbastanza nuovo per Backbone (http://dailyjs.com/2012/11/29/backbone-tutorial-1/),
Ecco il mio file package.json
.
{
"name": "btask"
, "version": "0.0.1"
, "private": true
, "dependencies": {
"requirejs": "latest"
, "connect": "2.7.0"
}
, "devDependencies": {
"mocha": "latest"
, "chai": "latest"
, "grunt": "latest"
, "grunt-exec": "latest"
}
, "scripts": {
"grunt": "node_modules/.bin/grunt"
}
}
Ed ecco una trascrizione completa dell'errore.
0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli '/Users/Keva161/.nvm/v0.8.18/bin/npm',
1 verbose cli 'run-script',
1 verbose cli 'grunt' ]
2 info using [email protected]
3 info using [email protected]
4 verbose read json /Users/Keva161/Documents/Web Dev/Webapps/Node/btask/package.json
5 verbose run-script [ 'pregrunt', 'grunt', 'postgrunt' ]
6 info pregrunt [email protected]
7 info grunt [email protected]
8 verbose unsafe-perm in lifecycle true
9 silly exec sh "-c" "node_modules/.bin/grunt"
10 silly sh,-c,node_modules/.bin/grunt,/Users/Keva161/Documents/Web Dev/Webapps/Node/btask spawning
11 info [email protected] Failed to exec grunt script
12 error [email protected] grunt: `node_modules/.bin/grunt`
12 error `sh "-c" "node_modules/.bin/grunt"` failed with 2
13 error Failed at the [email protected] grunt script.
13 error This is most likely a problem with the btask package,
13 error not with npm itself.
13 error Tell the author that this fails on your system:
13 error node_modules/.bin/grunt
13 error You can get their info via:
13 error npm owner ls btask
13 error There is likely additional logging output above.
14 error System Darwin 12.2.1
15 error command "node" "/Users/Keva161/.nvm/v0.8.18/bin/npm" "run-script" "grunt"
16 error cwd /Users/Keva161/Documents/Web Dev/Webapps/Node/btask
17 error node -v v0.8.18
18 error npm -v 1.2.4
19 error code ELIFECYCLE
20 verbose exit [ 1, true ]
Sei su Windows? Ho avuto problemi con grunt su Windows con quella configurazione ... – Ingro
no im su osx:/ive ha provato anche il grunt installato a livello globale ma lo stesso errore – Keva161
Non penso che sia il tuo caso ma ho dovuto cambiare la sezione "scripts" di package.json a questo per funzionare su Windows: '" grunt ":" node_modules \\. bin \\ grunt "' – Ingro