npm升级失败报了如下错误
$ npm install -g npm
npm ERR! path C:\Program Files\nodejs\npm.cmd
npm ERR! code EEXIST
npm ERR! Refusing to delete C:\Program Files\nodejs\npm.cmd: is outside C:\Program Files\nodejs\node_modules\npm and not a link
npm ERR! File exists: C:\Program Files\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\DELL\AppData\Roaming\npm-cache\_logs\2019-02-25T07_12_33_976Z-debug.log
windows10下安装的nvm1.1.7版本
//安装了node10.12.0版本 对应的npm是6.4.1
nvm install 10.12.0
nvm list
* 10.12.0 (Currently using 64-bit executable)
npm -v
6.4.1
不知道是哪里的问题导致升级失败的,然后要怎么解决才能成功呢,nvm重新卸载又安装了还是不行,npm install别的安装包没有问题。。
你看啊,这个log显示的很全面了,它说拒绝删除那个路径下的npm,让你立马移除这个npm重新尝试 Move it away, and try again.
C:Program Filesnodejsnode_modulesnpm
C:Program Filesnodejsnpm.cmd这个路径还存在一个错误
把node文件夹下自带的有关npx和npm的文件全部删除,执行这个:npm install npm@latest -g
是mac 升级出现错误 在命令前面家sudo
然后注意,npm的升级存在很多的问题,慎重慎重慎重