Grunt wiredep:app no such file or directory bower.json

别等时光非礼了梦想. 提交于 2019-11-28 17:25:56

There are two solutions to this issue depending on which version of wiredep you want to use.

If you want to use '^1.9.0', make sure to remove the cwd property from your Gruntfile.js. This is a common issue if you are an angular-generator user which currently specifies a cwd property on the config for the wiredep task.

If you don't mind using '1.8.0', make sure to pin that version in your package.json. If you are including wiredep via grunt-wiredep, then you will have to add wiredep manually and pin it. In the case that you stick with '1.8.0', leave the cwd property in the config for the task.

KnuturO

Nice after quite some searching on google joshs solution fixed my problem. I just removed <%= yeoman.app %>

wiredep: {      
  options:  { */code was here */ }
}

The solution is to delete the cwd property from the Grunfile.js

See this for reference:

https://github.com/stephenplusplus/grunt-wiredep/issues/100

cfranklin

This answer I found from Melmoth:

Grunt wiredep:app Cannot find Bower packages

Plus commenting out line 166 in gruntfile.js :

// cwd: '<%= yeoman.app %>'

fixed the issue for me.


Adding detail as per request

I am doing the Yeoman 1 hour codelab http://yeoman.io/codelab.html

After installation I ran grunt serve and got an error: Running "wiredep:app" (wiredep) task Warning: ENOENT, no such file or directory '../charlottesFolder/app/bower.json'

I tried moving:

charlottesFolder/bower.json to charlotteFolder/app/bower.json (don't actually do this as it was wrong)

which then threw the error: Running "wiredep:app" (wiredep) task Cannot find where you keep your Bower packages.

This led me to Melmoth's answer for Cannot find Bower packages - his solution worked in conjunction with commenting out the cwd line (currently line 166) in Gruntfile.js.

You has to set the grunt-wiredep dependency to the fix version.

"grunt-wiredep": "1.8.0",

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!