当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Grunt: Task "grunt-bower" not found

问题描述:

I want to install package grunt-bower for my grunt by using npm install grunt-bower --save. After I install, I see package grunt-bower inside node_modules. Here is my gruntfile.js:

module.exports = function(grunt) {

grunt.initConfig({

bower: {

dev: {

dest: 'public',

js_dest: 'public/javascripts',

css_dest: 'public/stylesheets'

}

},

watch: {

source: {

files: ['sass/**/*.scss', 'views/**/*.jade'],

tasks: ['sass'],

options: {

livereload: true, // needed to run LiveReload

}

}

}

});

grunt.loadNpmTasks('grunt-bower');

grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('default', ['grunt-bower']);

};

I have register this as on official page : grunt.loadNpmTasks('grunt-bower'); But when I run grunt command, I meet this error:

Warning: Task "grunt-bower" not found. Use --force to continue.

I don't know why. Does I do something wrong ? Please tell me.

Thanks :)

网友答案:

You've defined the task you want to run as bower and not grunt-bower therefore,

grunt.registerTask('default', ['grunt-bower']);

should be

grunt.registerTask('default', ['bower']);
分享给朋友:
您可能感兴趣的文章:
随机阅读: