NPM的镜像源和代理的查看和修改

                           NPM的镜像源和代理的查看和修改

一、镜像源

查询当前镜像源

npm get registry 

设置为淘宝镜像

npm config set registry http://registry.npm.taobao.org/

设置回默认的官方镜像

npm config set registry https://registry.npmjs.org/

设置electron淘宝镜像:

npm config set ELECTRON_MIRROR "https://npm.taobao.org/mirrors/electron/"

查看和删除electron淘宝镜像设置:

npm config get ELECTRON_MIRROR
npm config delete ELECTRON_MIRROR

二、代理

查看当前代理

npm config get proxy
npm config get https-proxy

设置代理

npm config set proxy http://server:port

npm config set https-proxy http://server:port

删除代理

npm config set proxy null
npm config set https-proxy null

 

你可能感兴趣的:(【封存】)