通过npm进行搭建vue时报如下错误:
C:UsersAdministrator>npm i vue-cli -g
npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
C:UsersAdministratorAppDataRoaming
pmvue-init -> C:UsersAdministratorAppDataRoaming
pm
ode_modulesvue-cliinvue-init
C:UsersAdministratorAppDataRoaming
pmvue-list -> C:UsersAdministratorAppDataRoaming
pm
ode_modulesvue-cliinvue-list
npm ERR! code EEXIST
npm ERR! path C:UsersAdministratorAppDataRoaming
pm
ode_modulesvue-cliinvue
npm ERR! dest C:UsersAdministratorAppDataRoaming
pmvue
npm ERR! EEXIST: file already exists, cmd shim 'C:UsersAdministratorAppDataRoaming
pm
ode_modulesvue-cliinvue' -> 'C:UsersAdministratorAppDataRoaming
pmvue'
npm ERR! File exists: C:UsersAdministratorAppDataRoaming
pmvue
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:
npm ERR! C:UsersAdministratorAppDataRoaming
pm-cache_logs2020-04-02T04_47_14_561Z-debug.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
解决办法
在这里插入图片描述
(Remove the existing file and try again, or run npm),删除现有的文件并且重试
直接前往 C:UsersAdministratorAppDataRoaming
pmvue找到这个vue文件然后删除,在重新全局安装,就可以了