[英]Grunt Error - Warning: Task “bower-install” not found
我刚刚尝试运行Angular-bootstrap
generator并回答所有选项,如下所示:
[?] What version of angular would you like to use? 1.2.15
[?] Which official angular modules would you need? animate, route
[?] Any third-party component you may require? bootstrap#~3.1.0
[?] Would you want me to support old versions of Internet Explorer (eg. before IE9)? nose arrow keys)
[?] Should I set up one of those JS preprocessors for you? none
[?] Should I set up one of those CSS preprocessors for you? sass
[?] What's the base name of your project? bootstrap
[?] Under which lincense your project shall be released? MIT
[?] Would you mind telling me your username on GitHub? mgcrea
一切运行正常,但当我尝试运行grunt serve或grunt build时,出现以下错误: Warning: Task "bower-install" not found. Use --force to continue.
Warning: Task "bower-install" not found. Use --force to continue.
我尝试运行bower install&npm install来解决此错误,但得到以下信息:n pm WARN package.json bootstrap@0.1.0 No README data
有谁对我如何解决这个问题有任何建议?
请尝试以下操作:
尝试使用“ bowerInstall”-而不是“ bower-install”,因为此选项已在更高版本中重命名(请参阅https://github.com/mgcrea/generator-angular-bootstrap/issues/2 )
确保从应用程序的根目录运行bowerInstall
看看您的Gruntfile.js-是否有一个功能“ bowerInstall”? 如果没有,只需添加:
bowerInstall: { target: { // Point to the files that should be updated when // you run `grunt bower-install` src: [ 'app/views/**/*.html', // .html support... 'app/*.html', // .html support... ], // Optional: // --------- cwd: '', dependencies: true, devDependencies: false, exclude: [], fileTypes: {}, ignorePath: '', overrides: {} } }
例如,您可以在函数filerev之后添加此函数:{....}
确保已安装“ grunt-bower-install”软件包。 看看您的package.json。 您应该在此处找到以下行:
“ grunt-bower-install”:“ ^ 1.6.0”,
如果没有,只需添加它,然后运行:
npm安装
咕unt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.