镜像相关操作 【待分离】
更换为淘宝镜像
第一种
npm install -g cnpm --registry=https://registry.npm.taobao.org
无法再使用
npm
,和IDE集成不友好
第二种
npm config set registry " https://registry.npm.taobao.org"
还行
第三种
编辑 ~/.npmrc文件,添加
registry = https://registry.npm.taobao.org
查看镜像
C:\Users\Administrator>npm config list
; cli configs
metrics-registry = "https://registry.npm.taobao.org/"
scope = ""
user-agent = "npm/5.5.1 node/v8.9.0 win32 x64"
; userconfig C:\Users\Administrator\.npmrc
registry = "https://registry.npm.taobao.org/"
; builtin config undefined
prefix = "C:\\Users\\Administrator\\AppData\\Roaming\\npm"
; node bin location = D:\program\node\node8\node.exe
; cwd = C:\Users\Administrator
; HOME = C:\Users\Administrator
; "npm config ls -l" to show all defaults.
C:\Users\Administrator>
还原镜像
npm config set registry https://registry.npmjs.org