美文网首页大前端
npm升级报错解决

npm升级报错解决

作者: 左木北鱼 | 来源:发表于2018-12-14 16:16 被阅读0次
    1. 今天想升级下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
    
    1. 查看配置:


      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.
    
    1. 最后执行cnpm i -g npm解决了
      cnpm i -g npm
      cnpm i -g npm

    相关文章

      网友评论

        本文标题:npm升级报错解决

        本文链接:https://www.haomeiwen.com/subject/tvpghqtx.html