Home > Back-end >  I can't use yarn anymore for some reason, tried to use a CRA and get this error
I can't use yarn anymore for some reason, tried to use a CRA and get this error

Time:02-21

I tried to reinstall node.js as some recommended but it didn't solve this problem

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: [] }

CodePudding user response:

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
  3. Check if that is your actual global node modules folder. 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

CodePudding user response:

I installed Yarn through Powershell executed as an administrator, then it started working again and I could create a project through CRA :D

  • Related