Error: Cannot find where you keep your Bower packages. Use --force to continue

自作多情 提交于 2019-11-29 01:07:04

问题


I'm building an App using MEAN Stack and trying to scaffold my frontend using yeoman-generator, when I do yo angular it fails to build and ends up in the following

  Running "wiredep:app" (wiredep) task
  Warning: Error: Cannot find where you keep your Bower packages. Use --force to continue.

Aborted due to warnings.

I'm stuck with this warning. I found a similar question here , but that solution didn't helped me.

Anyhelp will be greatly appreciated.


回答1:


I got the same error on

grunt serve.

It was solved when i tried

npm install --global yo bower grunt-cli 

npm install -g generator-angular

yo angular

grunt serve

if you get an error:-

Running "wiredep:app" (wiredep) task

Warning: Error: angular is not installed

. Try running bower install




回答2:


Put .bowerrc file inside of bower.json file directory.

It must be contain :

{
    "directory": "client/bower_components"
}

It may be your problem.




回答3:


For me it seemed to be link with the rights.
I had to manually create the bower_components folder:

mkdir -m 777 client/bower_components   

and run

bower install



回答4:


The Node version seems to be outdated and both the npm and nodejs is not installed globally:

To install globally run the following:

npm install --global yo bower grunt-cli 
npm install -g generator-angular

And start again, it will work for sure.




回答5:


I just got the error.

The solution for me was to add the bower_components folder on the root folder even if I did not have bower dependencies yet.




回答6:


Just run bower install and your code will run.



来源:https://stackoverflow.com/questions/31578794/error-cannot-find-where-you-keep-your-bower-packages-use-force-to-continue

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