【转载】npm 源地址设置及恢复

转自:https://www.cnblogs.com/nuomibaibai/p/16470559.html
npm 源地址设置及恢复

设置国内淘宝镜像
通过cnpm使用淘宝镜像:
npm install -g cnpm --registry=https://registry.npm.taobao.org

将npm设置为淘宝镜像:
npm config set registry https://registry.npm.taobao.org

查看当前npm源
npm config get registry

查看当前cnpm源
cnpm config get registry

如果设置了npm为淘宝镜像,需要恢复为默认源时:
npm config set registry=https://registry.npmjs.org

设置之后,记得通过npm config get registry 查看源是否设置成功

点赞

发表回复

电子邮件地址不会被公开。必填项已用 * 标注