To make this migration easier to understand I have split the parts of the upgrades into sections
- Update node to lts/hydrogen or node v18.20.8
- Install the latest version of yarn, yarn 4.6.3 at the time
- install nvm
#install and make node 18 the default
nvm install lts/hydrogen
nvm alias default lts/hydrogen
nvm use default
#remove the old yarn 1.22 if present
npm uninstall -g yarn
#install corepack a requirement to install yarn
npm i -g corepack
corepack install yarn
corepack enable yarn
#if this fails see https://github.com/nodejs/corepack/blob/main/README.md#corepack-enable--nam
- Update react-dom, @types/react, @types/react-dom, @types/react-router-dom to v18
- use npm-check-updates to see what packages need to change to satisfiy peer dependencies.
- additionally verify the correct peer depedencies with
yarn upgrade-interactive
npm install -g npm-check-updates
# run
ncu
# run
yarn upgrade-interactive