如何解决纱线在nuxt.js中显示命令抛出错误
我正在使用Yarn来安装Node程序。 当我在VS代码终端中启动我的nuxt.js项目并命令“ yarn dev”时,它不起作用,并且在终端下出现了错误。
internal/modules/cjs/loader.js:1032
throw err;
^
Error: Cannot find module 'C:\Users\**\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',requireStack: []
}
我已经开始使用纱线很多次了,这没问题。 但是这次突然发生了错误。 实际上,从1周前开始,我已经开始使用npm而不是yarn来启动nuxt.js项目。因为我想尝试不遵循yarn命令的nuxt.js插件。 但是npm的启动真的很慢,所以我想使用yarn agein。
我没有理由,但我尝试了第一步。我安装了node.js和yarn,但是安装yarn时再次发生错误。
在命令提示符下,我命令“ npm install -g yarn”和以下错误。
npm ERR! code EEXIST
npm ERR! path C:\Users\**\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
npm ERR! dest C:\Users\**\AppData\Roaming\npm\yarn
npm ERR! EEXIST: file already exists,cmd shim 'C:\Users\naoyuki\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js' -> 'C:\Users\naoyuki\AppData\Roaming\npm\yarn'
npm ERR! File exists: C:\Users\**\AppData\Roaming\npm\yarn
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:\Users\**\AppData\Roaming\npm-cache\_logs\2020-08-11T13_24_26_737Z-debug.log
C:\Users\**>npm install -g yarn
npm ERR! code EEXIST
npm ERR! path C:\Users\**\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
npm ERR! dest C:\Users\**\AppData\Roaming\npm\yarn
npm ERR! EEXIST: file already exists,cmd shim 'C:\Users\**\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js' -> 'C:\Users\**\AppData\Roaming\npm\yarn'
npm ERR! File exists: C:\Users\**\AppData\Roaming\npm\yarn
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:\Users\**\AppData\Roaming\npm-cache\_logs\2020-08-11T13_25_32_949Z-debug.log
我真的不明白为什么我不能突然使用纱线。 请帮帮我!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。