npm 设置代理

时间:2022-01-15 20:38:38

设置代理

npm config set proxy http://username:password@server:port
npm config set https-proxy http://username:password@server:port

删除代理

npm config delete proxy
npm config delete https-proxy

设置仓库

npm config set registry=http://registry.npmjs.org

npm config set registry=https://registry.npm.taobao.org

npm install --production --registry https://registry.npm.taobao.org

npm install -g xxxxxxx --registry https://registry.npm.taobao.org

npm install xxxxxxx --registry https://registry.npm.taobao.org