npm ERR! code EEXIST
npm ERR! path C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli\bin\vue.js
npm ERR! dest C:\Users\Administrator\AppData\Roaming\npm\vue
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli\bin\vue.js' -> 'C:\Users\Administrator\AppData\Roaming\npm\vue'
npm ERR! File exists: C:\Users\Administrator\AppData\Roaming\npm\vue
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
问题原因:
其实报错信息里已经说明了问题:
EEXIST: file already exists, cmd shim 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli\bin\vue.js' -> 'C:\Users\Administrator\AppData\Roaming\npm\vue'
存在:文件已经存在,在C:\Users\Administrator\AppData\Roaming\npm\vue目录下
就是你的全局下已经有了老版本的vue-cli,必须卸载老版本才行,但是我已经按照 vue官网的安装步骤卸载了,还是报错,这时必须手动删除
解决方法:
找到C:\Users\Administrator\AppData\Roaming\npm,这个目录里的东西就是你所有安装在全局的包,比如这是我的