Grunt突然停止了工作

时间:2014-08-31 04:47:03

标签: node.js gruntjs grunt-contrib-watch

昨天尝试在我的项目上运行Grunt build和Grunt监视,我遇到了跟​​随错误:

Fatal Error: Unable to find local grunt.

我确保文件未被删除。我尝试重新安装Node和Grunt。文件在那里,重新安装不起作用。我已经包含了调试文件以供参考。有谁知道这个问题是什么?

0 info it worked if it ends with ok
1 verbose cli [ 'E:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli   'E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install' ]
2 info using npm@1.3.24
3 info using node@v0.10.25
4 verbose node symlink E:\Program Files\nodejs\\node.exe
5 error install Couldn't read dependencies
6 error package.json ENOENT, open 'D:\sites\alleywire\package.json'
6 error package.json This is most likely not a problem with npm itself.
6 error package.json npm can't find a package.json file in your current directory.
7 error System Windows_NT 6.1.7601
8 error command "E:\\Program Files\\nodejs\\\\node.exe" "E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
9 error cwd D:\sites\alleywire
10 error node -v v0.10.25
11 error npm -v 1.3.24
12 error path D:\sites\alleywire\package.json
13 error code ENOPACKAGEJSON
14 error errno 34
15 verbose exit [ 34, true ]

1 个答案:

答案 0 :(得分:2)

您需要在本地安装grunt项目(不使用-g安装)。这与grunt-cli不同,后者是命令行上的grunt命令。

如果那里有npm install文件,请在项目文件夹中运行package.json