0

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: []
}
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437

2 Answers2

0

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
Dharman
  • 30,962
  • 25
  • 85
  • 135
0

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