Grunt在所有Windows用户中都无法工作。当我运行npm install
命令时,一些用户会遇到一些问题,输出以下消息。
E:\Worksapce\web>npm install
npm WARN package.json registers@4.0.0 No repository field.
当我尝试运行npm install -g grunt-cli
时,我认为它执行成功了。
E:\Worksapce\web>npm install -g grunt-cli
npm http GET http://registry.npmjs.org/grunt-cli
npm http 304 http://registry.npmjs.org/grunt-cli
npm http GET http://registry.npmjs.org/nopt
npm http GET http://registry.npmjs.org/findup-sync
npm http GET http://registry.npmjs.org/resolve
npm http 304 http://registry.npmjs.org/nopt
npm http 304 http://registry.npmjs.org/resolve
npm http 304 http://registry.npmjs.org/findup-sync
npm http GET http://registry.npmjs.org/abbrev
npm http 304 http://registry.npmjs.org/abbrev
npm http GET http://registry.npmjs.org/glob
npm http GET http://registry.npmjs.org/lodash
npm http 304 http://registry.npmjs.org/glob
npm http 304 http://registry.npmjs.org/lodash
npm http GET http://registry.npmjs.org/inherits
npm http GET http://registry.npmjs.org/minimatch
npm http 304 http://registry.npmjs.org/minimatch
npm http 304 http://registry.npmjs.org/inherits
npm http GET http://registry.npmjs.org/lru-cache
npm http GET http://registry.npmjs.org/sigmund
npm http 304 http://registry.npmjs.org/lru-cache
npm http 304 http://registry.npmjs.org/sigmund
C:\Users\user1234\AppData\Roaming\npm\grunt -> C:\Users\user1234\AppData\Roaming
\npm\node_modules\grunt-cli\bin\grunt
grunt-cli@0.1.13 C:\Users\user1234\AppData\Roaming\npm\node_modules\grunt-cli
+-- resolve@0.3.1
+-- nopt@1.0.10 (abbrev@1.0.5)
+-- findup-sync@0.1.3 (lodash@2.4.1, glob@3.2.11)
但是当我运行grunt时,我会得到这样的错误信息:
E:\Worksapce\web>
E:\Worksapce\web>grunt
'grunt' is not recognized as an internal or external command,
operable program or batch file.
我的package.json是这样的。
{
"author": "Company",
"name": "registers",
"version": "4.0.0",
"homepage": "http://abcd.se",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.4",
"grunt-contrib-jshint": "~0.9.2",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-less": "~0.11.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-ngmin": "0.0.3",
"grunt-contrib-jasmine": "~0.5.2"
}
}
另一个用户成功地执行了grunt而没有任何问题。这仅适用于一些用户。
有人能告诉我出了什么问题吗?