42

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?

ConcurrentHashMap
  • 4,998
  • 7
  • 44
  • 53
doron
  • 1,508
  • 3
  • 18
  • 27
  • 1
    I got this message this morning too. But for `grunt serve`. Yesterday it worked without any problems. – lfx Sep 07 '14 at 11:05
  • But if grunt won't work it won't build your app as it should. – doron Sep 07 '14 at 11:12
  • Experienced same issue here in OS X Mavericks. After reinstalling OS my project doesn't run `grunt serve` without `--force` anymore (plus got some CSS errors). – fer Sep 07 '14 at 11:41
  • Same problem. I've tried reinstall node and npm and clearing all caches but still the same result. – Alan Quigley Sep 07 '14 at 15:36

5 Answers5

86

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.

joshs
  • 1,890
  • 1
  • 17
  • 20
28

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

wiredep: {      
  options:  { */code was here */ }
}
Tasos K.
  • 7,979
  • 7
  • 39
  • 63
KnuturO
  • 1,565
  • 15
  • 19
4

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

See this for reference:

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

doron
  • 1,508
  • 3
  • 18
  • 27
  • I just tried this proposed solution and it reports that it is unable to find where it should install bower components. – joshs Sep 07 '14 at 16:02
4

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.

Community
  • 1
  • 1
cfranklin
  • 1,500
  • 1
  • 13
  • 14
-1

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

"grunt-wiredep": "1.8.0",

  • I upgraded grunt-wiredep to 1.8 in my package.json and didn't make any difference. I also tried joshs' solutions (1.9 and no cwd, 1.8 with default yeoman's angular-generator's cwd) and I still get the same warning message. – fer Sep 07 '14 at 19:09
  • wiredep: { options: { // cwd: '<%= yeoman.app %>' }, – Züthär Bärnd Sep 13 '14 at 17:52
  • there's a chance that the 'cwd' is not explicitly comes from your grunt config but came from some other task which ran before the wiredep - I had similar issue, I ran some tests before the wiredep and one of my tests contained a change dir command - check that lead – liron_hazan Jan 04 '16 at 15:14