Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm trying to deploy my Yeoman's Angular app to my production server. When I try to run the grunt build command I get this error:

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.

If I use grunt --force my app is broken...

I'm on Ubuntu 14.04

Any ideas?

like image 497
doron Avatar asked Sep 07 '14 10:09

doron


4 Answers

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.

like image 70
joshs Avatar answered Nov 07 '22 18:11

joshs


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

wiredep: {      
  options:  { */code was here */ }
}
like image 39
KnuturO Avatar answered Nov 07 '22 18:11

KnuturO


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

See this for reference:

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

like image 4
doron Avatar answered Nov 07 '22 20:11

doron


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.

like image 4
cfranklin Avatar answered Nov 07 '22 20:11

cfranklin