一、现象描述
前提:npm registry 已设置为淘宝镜像地址( http://172.1.1.240:8081/repository/npm-taobao-group/
)。通过 npm install --global yarn
命令可以安装成功。设置 yarn registry 地址( http://172.1.1.240:8081/repository/npmjs_taobao.org
)。
然后使用 yarn install 命令执行。结果报错 ResponseError: Request failed “500 Internal Server Error”
,详情内容如下:
二、问题原因
npm registry 与 yarn registry 地址不同导致的。
三、解决方案
将 npm 与 yarn 的registry 地址设置为相同即可。以下是我自己的操作。
将 npm config set registry http://172.1.1.240:8081/repository/npmjs_taobao.org
即可。然后再次执行 yarn install
命令,过了一会儿显示执行成功。如下图所示:
本文完结!