发布于 4年前

Bower报401错误原因:Bower1.8.2 registry地址迁移到https://registry.bower.io

Bower1.8.2开始,原来的registry url http://bower.herokuapp.com 被废弃,新的registry ur迁移到https://registry.bower.io

对于Bower1.8.2之前的版本,如果没有修改registry url,使用bower时会报401错误,如下:

EINVRES Request to https://bower.herokuapp.com/packages/angular-cookies failed with 410

解决方法

方法一:升级bower到最新版本(推荐

sudo npm cache clean
npm update -g bower

如果升级失败,可以先卸载,然后再安装bower

npm -g uninstall bower
npm -g install bower

安装后可能需要新打开shell使用。

方法二:更改bower的registry url

在.bowerrc修改registry url。

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

参考:https://gist.github.com/sheerun/c04d856a7a368bad2896ff0c4958cb00

©2020 edoou.com   京ICP备16001874号-3