简体   繁体   English

由于某种原因我不能再使用 yarn,尝试使用 CRA 并得到这个错误

[英]I can't use yarn anymore for some reason, tried to use a CRA and get this error

I tried to reinstall node.js as some recommended but it didn't solve this problem我尝试按照一些建议重新安装 node.js 但它没有解决这个问题

Error: Cannot find module 'C:\Users\João\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Ideas:想法:

  1. Check if yarn is actually installed on that path检查纱线是否实际安装在该路径上
  2. Check node binaries folder is registered to your system path node_modules/.bin检查节点二进制文件夹是否已注册到您的系统路径 node_modules/.bin
  3. Check if that is your actual global node modules folder.检查这是否是您实际的全局节点模块文件夹。 https://docs.npmjs.com/cli/v7/commands/npm-root https://docs.npmjs.com/cli/v7/commands/npm-root
  4. Might be easier to maintain if you install yarn as a standalone app instead of a npm package: https://classic.yarnpkg.com/en/docs/install#windows-stable如果将 yarn 安装为独立应用程序而不是 npm package: https: https://classic.yarnpkg.com/en/docs/install#windows-stable可能更容易维护

I installed Yarn through Powershell executed as an administrator, then it started working again and I could create a project through CRA:D我通过以管理员身份执行的 Powershell 安装了 Yarn,然后它又开始工作了,我可以通过 CRA:D 创建一个项目

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 REACT(cra):当试图在fullcalendar的“eventRender”中使用jQuery时,我得到错误:$ el.popover不是函数 - REACT (cra): When trying to use jQuery in fullcalendar's “eventRender” I get the error: $el.popover is not a function 我们如何在 React 中使用 d3-funnel? 我尝试实现它但遇到一些错误 - How can we use d3-funnel with React? I tried implementing it but getting some errors 无论我出于某种原因尝试什么,都无法让 SCSS/CSS 在 React App 中呈现 - Can't get SCSS/CSS to render in React App no matter what I try for some reason 如何通过CRA使用不同的CSS重置样式表? - How do I use different CSS reset stylesheets through CRA? 由于未知原因,React hooks 无法使用 setState - React hooks can't use setState for unknown reason setState的未定义和用户身份验证错误。 尝试.bind(this)。 试过胖子……无法正常工作 - setState of Undefined & User Authentication Error. Tried .bind(this). Tried fatpipe… Can't get it working JEST 抛出错误:无法在使用 CRA 和 TS 制作的 REact 应用程序的模块外使用导入语句; 我已经在寻找解决方案但没有用 - JEST throws error: Cannot use import statement outside a module in REact app made with CRA, with TS; I am afterew solution already but not work 错误:在安装 CRA 应用程序的纱线时写入 EIO 错误 - Error: write EIO error while yarn install of CRA application 当我想使用纱线时出错 - Errors when i want to use yarn 当我使用 antd 时,终端出现一些错误 - when i use antd,there are some error in terminal
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM