我想不出我的配置问题。当我尝试运行“咕噜咕噜”时,我会收到以下错误消息:
警告:找不到任务“保龄球”。继续使用武力。
如果我运行'grunt jshint',jshint可以正常工作。
这是我的package.json:
{
"name": "treblebull",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "~3.2.6",
"jade": "~0.31.2",
"underscore": "~1.5.2",
"pg": "~2.11.1"
},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-bowercopy": "~0.7.1",
"grunt-contrib-jshint": "~0.8.0",
"load-grunt-tasks": "~0.2.1"
}
}这是我的档案:
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
lib: {
src: ['lib/**/*.js']
},
test: {
src: ['test/**/*.js']
}
},
bowercopy: {
options: {
clean: true
//srcPrefix: 'bower_components'
},
libs: {
options: {
// destPrefix: 'public/js/lib'
},
files: {
'angular.js': 'angular/angular.js'
//'underscore.js': 'underscore/underscore.js',
//'underscore.string.js': 'underscore.string/underscore.string.js'
}
}
}
});
grunt.loadNpmTasks('grunt-bowercopy');
grunt.loadNpmTasks('grunt-contrib-jshint');
};发布于 2014-01-25 14:32:15
运行bower init为自己提供要读取的bowercopy任务的bower.json文件。另外,如果您已经通过bower安装了所有东西,那么在您的runBower散列中将false设置为false。
如果您曾经遇到过Grunt故障,那么使用--v (详细)标志进行运行是值得的,以查看它到底在失败什么。我亲自运行它,我看到它正在寻找一个bower.json,一旦我提供了一个,任务就成功了。
发布于 2014-02-06 18:06:49
由于我不能对@dcodesmith的答案发表评论,所以我不得不留下答案。我遇到了一个问题,因为实际上添加了grunt.registerTask('bowercopy', ['bowercopy']);,称为bowercopy的任务,但它实际上不起作用。删除它实际上允许bowercopy复制文件。
https://stackoverflow.com/questions/21346537
复制相似问题