小编vit*_*-ne的帖子

错误:找不到模块'time-grunt'

我尝试安装time-grunt本地和全局,清除npm缓存,更新npm,但没有任何帮助.我明白了:

 Loading "Gruntfile.js" tasks...ERROR
 Error: Cannot find module 'time-grunt'
 Warning: Task "default" not found. Use --force to continue.
Run Code Online (Sandbox Code Playgroud)

我的版本od包:节点:'0.10.31',npm:'1.4.23'

运行后:npm install --save-dev time-grunt in package.json state:

"devDependencies": {
"grunt": "^0.4.5",
...
"time-grunt": "^1.0.0"
}
Run Code Online (Sandbox Code Playgroud)

这是我的grunfile.js的一部分:

module.exports = function( grunt ) {
     require('time-grunt')(grunt);

     grunt.initConfig({
     // grunt tasks here
     });
     // load tasks here
     // register task here
}
Run Code Online (Sandbox Code Playgroud)

其他grunt任务运行没有错误.

我不明白有什么不对.

我如何通过命令行正确测试time-grunt的安装?

node.js npm gruntjs

15
推荐指数
2
解决办法
3万
查看次数

标签 统计

gruntjs ×1

node.js ×1

npm ×1