我用以下命令为项目设置了一切:
sudo npm install -g grunt-cli
sudo npm install grunt --save-dev
sudo npm install grunt-contrib-jshint --save-dev
sudo npm install jshint-stylish --save-dev
sudo npm install time-grunt --save-dev
sudo npm install jit-grunt --save-dev
这是我的package.json文件:
{
"name": "Project1",
"private": true,
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.12.0",
"jit-grunt": "^0.9.1",
"jshint-stylish": "^2.1.0",
"time-grunt": "^1.3.0"
},
"engines": {
"node": ">=0.10.0"
}
}
当我运行 'grunt' 命令时,它会出现以下错误:
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'time-grunt'
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
node_modules/time-grunt
的文件夹吗? - topheman