问题描述
我建立一个角应用与溜溜角genertor,
I build a Angular App with Yo angular-genertor,
我是建设有咕噜应用程序构建好,那么我加引导3,也NPM安装咕噜鲍尔安装
I was building the app with Grunt Build fine, then I added Bootstrap 3 and also npm install grunt-bower-install
我添加了这些行繁重的文件
I added these lines to the Grunt file
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
//ADDED THIS LINE
grunt.loadNpmTasks('grunt-bower-install');
grunt.initConfig({
yeoman: {
// configurable paths
app: require('./bower.json').appPath || 'app',
dist: 'dist'
},
//ADDED THESE LINES
'bower-install': {
target: {
src: [
'app/index.html'
],
}
},
我已删除了这行但是!
I have removed these line however!
现在咕噜构建抛出这个错误
Now Grunt Build is throwing this error
Running "bowerInstall:app" (bowerInstall) task
Warning: Cannot read property 'main' of undefined Use --force to continue.
Aborted due to warnings.
我不知道该怎么办,甚至从哪里开始?
I do know what to do or even where to start?
推荐答案
在我的自耕农生成的项目这个任务是这样的:
In my yeoman generated project this task looks like:
'bower-install': {
app: {
html: '<%= yeoman.app %>/index.html',
ignorePath: '<%= yeoman.app %>/'
}
},
在新的版本,而不是 HTML
使用的src
:
In newer version instead of html
uses src
:
'bowerInstall': {
app: {
src: ['<%= yeoman.app %>/index.html'],
ignorePath: '<%= yeoman.app %>/'
}
},
也许你使其适应你的情况。虽然我认为它应该没有变化工作。
Maybe you adapt it to your case. Though i think it should work without changes.
但你在另一个地方几乎是相同的,所以也许这个问题。
But you have almost the same, so maybe the problem in another place.
这篇关于咕噜筹建不育角工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!