- 今天想升级下
npm
,执行npm i -g npm
总是报错,如下图所示:
npm升级报错
PS C:\Users\Administrator> npm i -g npm
npm ERR! path G:\dev\nodejs\npm.cmd
npm ERR! code EEXIST
npm ERR! Refusing to delete G:\dev\nodejs\npm.cmd: is outside G:\dev\nodejs\node_modules\npm and not a link
npm ERR! File exists: G:\dev\nodejs\npm.cmd
npm ERR! Move it away, and try again.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-12-14T07_51_25_608Z-debug.log
-
查看配置:
npm config
PS C:\Users\Administrator> npm config ls
; cli configs
metrics-registry = "https://registry.npm.taobao.org/"
scope = ""
user-agent = "npm/5.5.1 node/v8.9.1 win32 x64"
; userconfig C:\Users\Administrator\.npmrc
registry = "https://registry.npm.taobao.org/"
; node bin location = G:\dev\nodejs\node.exe
; cwd = C:\Users\Administrator
; HOME = C:\Users\Administrator
; "npm config ls -l" to show all defaults.
- 最后执行
cnpm i -g npm
解决了
cnpm i -g npm
cnpm i -g npm
网友评论