错误:
当执行该命令时
npm install -g @vue/cli
出现报错:npm ERR! path D:\software\nodejs\node_global\node_modules@vue\cli\bin\ npm ERR! dest D:\software\nodejs\node_global\vue npm ERR! EEXIST: file already exists, cmd shim ‘D:\software\nodejs\node_global\node_modules@vue\cli\bin\’ -> ‘D:\software\nodejs\node_global\vue’ npm ERR! File exists: D:\software\nodejs\node_global\vue npm ERR! Remove the existing file and try again, or run npm npm ERR! with --force to overwrite files recklessly.
错误原因:
可能是由于之前安装过vue或者其他相关的软件包,导致冲突的文件没有被正确删除
解决方法:
使用下面命令安装且覆盖原来存在的文件
npm install -g @vue/cli --force