当前位置: 代码迷 >> 综合 >> 安装vue-cli时报错:This is related to npm not being able to find a file.
  详细解决方案

安装vue-cli时报错:This is related to npm not being able to find a file.

热度:39   发布时间:2023-12-16 01:38:49.0

在执行 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即可。

  相关解决方案