在执行 npm install vue-cli -g时报如下错误:
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:/Users/wyhui/AppData/Roaming/npm/node_modules/vue-cli/node_modules/xxxx'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
解决办法:
去到报错信息中指定的那个目录“C:/Users/wyhui/AppData/Roaming/npm/node_modules/vue-cli”,将node_modules目录删掉,然后重新执行npm install vue-cli -g即可。