node.js 错误:找不到保存 Bower 包的位置。使用 --force 继续
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31578794/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error: Cannot find where you keep your Bower packages. Use --force to continue
提问by Naveen Vijayakumar
I'm building an App using MEAN Stackand trying to scaffold my frontend using yeoman-generator, when I do yo angularit fails to build and ends up in the following
我正在使用MEAN Stack构建一个应用程序并尝试使用yeoman-generator搭建我的前端,当我做yo angular 时,它无法构建并最终出现在以下内容中
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.
任何帮助将不胜感激。
回答by varna
I got the same error on
我遇到了同样的错误
grunt serve.
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
运行“wiredep:app”(wiredep)任务
警告:错误:未安装角度
. Try running bower install
. 尝试跑步bower install
回答by Julien Malige
For me it seemed to be link with the rights.
I had to manually create the bower_components folder:
对我来说,这似乎与权利有关。
我必须手动创建 bower_components 文件夹:
mkdir -m 777 client/bower_components
and run
并运行
bower install
回答by viam
Put .bowerrc file inside of bower.json file directory.
将 .bowerrc 文件放在 bower.json 文件目录中。
It must be contain :
它必须包含:
{
"directory": "client/bower_components"
}
It may be your problem.
这可能是你的问题。
回答by Aman Jain
Just run bower installand your code will run.
只需运行bower install,您的代码就会运行。
回答by Thamizhselvan
The Node version seems to be outdated and both the npmand nodejsis not installed globally:
节点版本似乎已经过时,无论是npm与nodejs不是全球的装机量:
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.
重新开始,它肯定会起作用。
回答by C0ZEN
I just got the error.
我刚收到错误。
The solution for me was to add the bower_componentsfolder on the root folder even if I did not have bower dependencies yet.
我的解决方案是将bower_components文件夹添加到根文件夹中,即使我还没有 bower 依赖项。

