Gruntjs 在windows上使用grunt
我已经在yeoman项目中全局和本地安装了grunt,但是所有grunt命令都会出现以下错误。你知道怎么避开这个吗Gruntjs 在windows上使用grunt,gruntjs,yeoman,Gruntjs,Yeoman,我已经在yeoman项目中全局和本地安装了grunt,但是所有grunt命令都会出现以下错误。你知道怎么避开这个吗 c:\wip\code\project\yo>grunt -v Initializing Command-line options: --verbose c:\wip\code\project\yo\node_modules\grunt\lib\grunt\file.js:372 return fs.existsSync(filepath); ^
c:\wip\code\project\yo>grunt -v
Initializing
Command-line options: --verbose
c:\wip\code\project\yo\node_modules\grunt\lib\grunt\file.js:372
return fs.existsSync(filepath);
^
TypeError: Object #<Object> has no method 'existsSync'
at Object.exists (c:\wip\code\project\yo\node_modules\grunt\lib\grunt\fil
e.js:372:13)
at Task.init (c:\wip\code\project\yo\node_modules\grunt\lib\grunt\task.js
:417:31)
at Object.tasks (c:\wip\code\project\yo\node_modules\grunt\lib\grunt.js:1
13:8)
at Object.cli (c:\wip\code\project\yo\node_modules\grunt\lib\grunt\cli.js
:38:9)
at Object.<anonymous> (C:\Users\me\AppData\Roaming\npm\node_modules\
grunt-cli\bin\grunt:41:20)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Array.0 (module.js:484:10)
c:\wip\code\project\yo>grunt-v
初始化
命令行选项:--verbose
c:\wip\code\project\yo\node\u modules\grunt\lib\grunt\file.js:372
返回fs.existsSync(filepath);
^
TypeError:对象#没有方法“existsSync”
在Object.exists(c:\wip\code\project\yo\node\u modules\grunt\lib\grunt\fil
e、 js:372:13)
在Task.init(c:\wip\code\project\yo\node\u modules\grunt\lib\grunt\Task.js
:417:31)
在Object.tasks(c:\wip\code\project\yo\node\u modules\grunt\lib\grunt.js:1
13:8)
在Object.cli(c:\wip\code\project\yo\node\u modules\grunt\lib\grunt\cli.js
:38:9)
反对。(C:\Users\me\AppData\Roaming\npm\node\u模块\
grunt cli\bin\grunt:41:20)
在模块处编译(Module.js:446:26)
at Object..js(module.js:464:10)
在Module.load(Module.js:353:31)
at函数。_加载(module.js:311:12)
at Array.0(module.js:484:10)
您似乎正在使用node.jsv0.6(因为在v0.8中,fs.existsSync
已移动到fs
)
Grunt仅与node.js=0.8
兼容