让NPM加速要么设置国内镜像 要么走梯子加速

淘宝大法

设置淘宝镜像(同步频率约为10分钟)

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

npm config set disturl https://npm.taobao.org/dist

删除淘宝镜像

npm config delete registrynpm config delete disturl

梯子大法(端口自己根据自己的配置改)

请自备梯子

npm config set proxy=http://127.0.0.1:1080 
npm config set registry=http://registry.npmjs.org //设置为官方NPM源

如果需要用户名

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

取消代理

npm config delete proxy
npm config delete https-proxy

yarn设置代理

yarn config set proxy http://127.0.0.1:1080
yarn config set https-proxy http://127.0.0.1:1080

取消

yarn config delete proxy
yarn config delete https-proxy
Last modification:June 1st, 2020 at 10:48 pm
If you think my article is useful to you, please feel free to appreciate