NPM
配置镜像仓库
- 查看默认仓库地址
npm config get registry
# 输出为:https://registry.npmjs.org/
- 修改默认仓库地址
# 设置为私服地址http://nexus.tangyuewei.com/repository/npm-public/
npm config set registry http://nexus.tangyuewei.com/repository/npm-public/
# 设置为淘宝镜像地址
npm config set registry https://registry.npm.taobao.org
修改客户端配置(私服需要配置)
这里需要在私服创建认证账号,及角色,本文就略过了。
自己的私服,需要配置NPM
客户端信息,修改 C:\Users\用户名\.npmrc
registry=http://nexus.tangyuewei.com/repository/npm-public/
email=472680811@qq.com
always-auth=true
_auth="ZGVwbG95ZXI6ZGVwbG95ZXI="
注意: _auth是
username:password
的base64
值,可以通过Linux
命令echo -n 'username:password' | openssl ba