Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node:internal/modules/cjs/loader:936 Error: Cannot find module '.yarn/releases/yarn-3.0.2.cjs'

Tags:

yarnpkg

When I use the Yarn command, it always shows the error message:

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '/.yarn/releases/yarn-3.0.2.cjs'
    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:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v17.0.1

like image 812
cannnnnnnddddd Avatar asked Oct 24 '25 05:10

cannnnnnnddddd


1 Answers

Try to do the following:

  1. Run rm ~/.yarnrc
  2. Run rm yarn.lock and rm .yarnrc.yml (if these files exist) from your project's directory
  3. Remove entry "packageManager": "[email protected]" from your package.json
  4. Run yarn install

I found an explanation why this is happening here: https://github.com/yarnpkg/yarn/issues/8460

like image 157
pkirilin Avatar answered Oct 26 '25 23:10

pkirilin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!