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

后端 未结 5 1399
滥情空心
滥情空心 2020-12-13 06:24

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:

相关标签:
5条回答
  • 2020-12-13 06:35

    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.

    0 讨论(0)
  • 2020-12-13 06:41

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

    See this for reference:

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

    0 讨论(0)
  • 2020-12-13 06:49

    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.

    0 讨论(0)
  • 2020-12-13 06:57

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

    wiredep: {      
      options:  { */code was here */ }
    }
    
    0 讨论(0)
  • 2020-12-13 06:58

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

    "grunt-wiredep": "1.8.0",

    0 讨论(0)
提交回复
热议问题