npm国内代理设置
目录
检查已有代理
npm config get proxy
npm config get https-proxy
默认是无代理null
取消已有代理
npm config set proxy null
npm config set https-proxy null
#或者
npm config delete proxy
npm config delete https-proxy
使用taobao.org代理
npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist
测试
> npm -g install typescript
C:\Users\jm\AppData\Roaming\npm\tsc -> C:\Users\jm\AppData\Roaming\npm\node_modules\typescript\bin\tsc
C:\Users\jm\AppData\Roaming\npm\tsserver -> C:\Users\jm\AppData\Roaming\npm\node_modules\typescript\bin\tsserver
+ typescript@4.4.3
added 1 package from 1 contributor in 3.178s
如果输出版本号,说明安装成功
> tsc -v
Version 4.4.3
markdown @tsingchan