Javascript EINVRES 请求 https://bower.herokuapp.com/packages/ 失败,返回 502

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/51020317/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 04:44:10  来源:igfitidea点击:

EINVRES Request to https://bower.herokuapp.com/packages/ failed with 502

javascriptbower

提问by Nithin Baby

Bower install fails with 502 - Bad Gateway when downloading bower packages.

下载 Bower 软件包时,Bower 安装失败并显示 502 - Bad Gateway。

For example bower install for ember library gives following response in command line.

例如,为 ember 库安装 bower 会在命令行中给出以下响应。

EINVRES Request to https://bower.herokuapp.com/packages/emberfailed with 502

https://bower.herokuapp.com/packages/ember 的EINVRES 请求失败,错误为 502

When http://bower.herokuapp.com/is accessed directly from URL it gives the following message.

当直接从 URL 访问http://bower.herokuapp.com/ 时,它会给出以下消息。

This Bower version is deprecated. Please update it: npm install -g bower. The new registry address is https://registry.bower.io

此 Bower 版本已弃用。请更新它:npm install -g bower。新的注册地址是https://registry.bower.io

回答by Nithin Baby

Bower is deprecating their registry hosted with Heroku. http://bower.herokuapp.com/Will not be accessible anymore or it might be down intermittently, therefore, forcing users to a new registry.

Bower 正在弃用由 Heroku 托管的注册表。http://bower.herokuapp.com/将无法再访问,或者它可能会间歇性地关闭,因此,迫使用户使用新的注册表。

Users working on old bower versions can update the .bowerrcfile with the following data.

使用旧 bower 版本的用户可以使用以下数据更新.bowerrc文件。

{
  "registry": "https://registry.bower.io"
}

.bowerrcfile can be located at the same folder where bower.jsonand bower_componentsfolder is located. If it is not present already, you can make one.

.bowerrc文件可以位于bower.jsonbower_components文件夹所在的同一文件夹中。如果它不存在,您可以制作一个。

For references check the below links

如需参考,请查看以下链接

回答by tkarls

Simplest solution is to just upgrade bowerto latest version

最简单的解决方案是将 bower 升级到最新版本

If installed via NPM:

如果通过 NPM 安装:

npm i -g bower

回答by Nayas Subramanian

When using asp.net core then should change something like this. bowerrc.json you can find inside project folder.

当使用 asp.net core 时,应该改变这样的东西。bowerrc.json 你可以在项目文件夹中找到。

  {
     "registry": "https://registry.bower.io",
     "directory": "wwwroot/lib"
  }

回答by Le Hoai Duc

If you use windows to install npm, You must run "Node.js command prompt" with administrator and run this command: npm i -g bower. I tried and worked :)

如果您使用 Windows 安装 npm,您必须以管理员身份运行“Node.js 命令提示符”并运行此命令:npm i -g bower。我尝试过并工作过:)

回答by territorial

echo '{"registry": "https://components.bower.io","directory": "wwwroot/lib"}' > .bowerrc

echo '{"registry": "https://components.bower.io","directory": "wwwroot/lib"}' > .bowerrc