如果我使用Running "wiredep:app" (wiredep) task Warning: ENOENT, no such file or directory '/usr/share/nginx/html/data/gaia-app/app/bower.json' Use --force to continue.
grunt --force
,我的应用程序会崩溃...我使用的是Ubuntu 14.04。
有任何想法吗?
如果我使用Running "wiredep:app" (wiredep) task Warning: ENOENT, no such file or directory '/usr/share/nginx/html/data/gaia-app/app/bower.json' Use --force to continue.
grunt --force
,我的应用程序会崩溃...根据您想要使用的wiredep版本,此问题有两种解决方案。
如果您想要使用'^1.9.0'版本,请确保从您的Gruntfile.js文件中删除cwd属性。如果您是angular-generator用户,则这是常见问题,因为当前在wiredep任务的配置中指定了cwd属性。
如果您不介意使用'1.8.0'版本,请确保在package.json文件中固定该版本。如果您通过grunt-wiredep包含wiredep,则必须手动添加并固定它。如果您坚持使用'1.8.0'版本,则需要在任务的配置中保留cwd属性。
在Google上找了很久之后,Josh的解决方案解决了我的问题。我只是删除了<%= yeoman.app %>
wiredep: {
options: { */code was here */ }
}
wiredep
中删除了整个 options
对象以消除错误。 - race_carr我在Melmoth的回答中找到了这个答案:
Grunt wiredep:app 无法找到 Bower 包
还有在Gruntfile.js文件中注释掉第166行:
// cwd: '<%= yeoman.app %>'
对我来说解决了问题。
根据要求添加细节
我正在进行 Yeoman 1 小时 codelab http://yeoman.io/codelab.html
安装后,我运行 grunt serve
,得到一个错误:Running "wiredep:app" (wiredep) task
Warning: ENOENT, no such file or directory '../charlottesFolder/app/bower.json'
我尝试将:
charlottesFolder/bower.json
移动到 charlotteFolder/app/bower.json
(不要这样做,因为是错的)
然后抛出错误:Running "wiredep:app" (wiredep) task
Cannot find where you keep your Bower packages.
这让我看到了Melmoth的答案,对于Cannot find Bower packages
- 他的解决方案与注释掉Gruntfile.js
中的cwd
行(目前是第166行)一起使用。
你需要将grunt-wiredep依赖设置为固定版本。
"grunt-wiredep": "1.8.0",
grunt serve
。昨天它没有任何问题。 - lfxgrunt serve
命令,除非加上--force
参数(还有一些 CSS 错误)。 - fer