Trying to upgrade from React Native to 0.73.6 to 0.74.2.
React Native upgrade instructions said to add the following
packageManager": "[email protected]
to package.json and add the following to a file ".yarnrc.yml" with this content. There is no directory yarn/releases/yarn-3.6.4.cjs
nodeLinker: node-modules yarnPath: .yarn/releases/yarn-3.6.4.cjs
But I now get the following error
node:internal/modules/cjs/loader:1148
throw err;
^
Error: Cannot find module ‘/Users/user/Dir/Dir2/.yarn/releases/yarn-3.6.4.cjs’
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: ‘MODULE_NOT_FOUND’,
requireStack: [] }
I have attempted to set yarn to berry and have performed corepack enable
Node.js v20.14.0
2
Answers
Finally figured it out. In your project directory and your home directory run remove all yarn files and folders. $cd ~ && rm -rf .yarn/ && rm -f yarn.lock then run $ yarn set version 3.6.4.
I then had issues with Watchman so I ran $ brew uninstall watchman && brew update && brew install watchman followed by $ watchman watch-del-all $ watchman shutdown-server
Hope this saves you a few hours
seems like removing
~/.yarn
is not necessarythis is what worked for me:
.yarnrc.yml
, i triedyarn set version 3.6.4
.yarn/releases/yarn-3.6.4.cjs
and updates thepackage.json
(adds the"packageManager": "[email protected]"
line)yarn