【发布时间】:2015-03-07 15:43:12
【问题描述】:
我尝试安装 time-grunt local 和 global,清除 npm 缓存,更新 npm,但没有任何帮助。 我明白了:
Loading "Gruntfile.js" tasks...ERROR
Error: Cannot find module 'time-grunt'
Warning: Task "default" not found. Use --force to continue.
我的软件包版本: 节点:'0.10.31', npm: '1.4.23'
运行后: npm install --save-dev time-grunt 在 package.json 状态:
"devDependencies": {
"grunt": "^0.4.5",
...
"time-grunt": "^1.0.0"
}
这是我的 grunfile.js 的一部分:
module.exports = function( grunt ) {
require('time-grunt')(grunt);
grunt.initConfig({
// grunt tasks here
});
// load tasks here
// register task here
}
其他 grunt 任务运行时没有错误。
我不明白出了什么问题。
如何通过 CLI 测试 time-grunt 的正确安装?
【问题讨论】:
-
您能否向我们展示 Gruntfile.js 以确保您确实需要模块等
-
这是我的 grunfile.js 的一部分: module.exports = function( grunt ) { require('time-grunt')(grunt); grunt.initConfig({ .. }); ... }
-
似乎节点模块没有被正确查找或 grunt-time 没有正确安装。有了可用的信息,我无能为力
-
安装 grun-time 后,我在项目子文件夹 node_modules 中有新文件夹“time-grunt”。粉丝请注意我的问题)
-
如何通过命令行正确测试 time-grunt 的安装?