react-native-template-new-architecture icon indicating copy to clipboard operation
react-native-template-new-architecture copied to clipboard

Upgrade Yarn 3.2.1 to 4.0.0-rc.9+

Open leotm opened this issue 2 years ago โ€ข 4 comments

Only issue in Linux CI, macOS 13b locally is fine

Latest checked: rc.14

Ubuntu2204 (20220605.1)

yarn install
โžค YN0000: โ”Œ Resolution step
โžค YN0078: โ”‚ Invalid resolution node-forge@npm:^0.10.0 โ†’ npm:1.2.1 (yarn why: ... RN Flipper)
โžค YN0000: โ”” Completed
โžค YN0000: Failed with errors in 0s 137ms
  • revert yarn.lock (v4 -> v3)
  • revert (old v3) resolution commit
  • yarn install (regen v4 lockfile)
yarn --check-resolutions
โžค YN0000: โ”Œ Resolution step
โžค YN0078: โ”‚ Invalid resolution prismjs@npm:~1.17.0 โ†’ npm:1.26.0 (yarn why: ... @storybook)
โžค YN0000: โ”” Completed
โžค YN0000: Failed with errors in 0s 137ms
  • repeat

Similar on macOS Monterey 12.5 Beta

  • doesn't block yarn install
  • detected via yarn --check-resolutions

Next step

  • https://github.com/yarnpkg/berry/pull/4302#issuecomment-1155272717
  • [x] delete lockfile -> install v4?

Follow-up

  • https://github.com/leotm/react-native-template-new-architecture/pull/846

Still need to undo resolutions


Close: #671

leotm avatar Jun 13 '22 15:06 leotm

Check

  • https://github.com/yarnpkg/berry/pull/4218
  • https://github.com/yarnpkg/berry/pull/4302
    • showing up on macOS too
    • but no install blocker

leotm avatar Jun 14 '22 11:06 leotm

Yarn 4.0.0-rc.9 --check-resolutions (can't check in v3) recognising all prev/old v3 (manual) set resolutions Invalid

yarn set version canary
yarn install
yarn --check-resolutions
โžค YN0000: โ”Œ Resolution step
โžค YN0078: โ”‚ Invalid resolution node-forge@npm:^0.10.0 โ†’ npm:1.2.1 (yarn why: ... RN Flipper)
โžค YN0000: โ”” Completed
โžค YN0000: Failed with errors in 0s 137ms

revert yarn.lock (v4 -> v3)

revert (old v3) resolution commit

yarn install (regen v4 lockfile)

yarn --check-resolutions
โžค YN0000: โ”Œ Resolution step
โžค YN0078: โ”‚ Invalid resolution prismjs@npm:~1.17.0 โ†’ npm:1.26.0 (yarn why: ... @storybook)
โžค YN0000: โ”” Completed
โžค YN0000: Failed with errors in 0s 137ms

yarn install blocker on Ubuntu, not on macOS but still detected

leotm avatar Jun 14 '22 13:06 leotm

yarn patch --revert-all --dev-deps needed ๐Ÿ˜… or yarn reset resolutions -D or lockfile codemod

edit: ok only few

  • https://github.com/leotm/react-native-template-new-architecture/commit/5bc69b5dbf674ee2f5a17e52909c62690453e6ef
  • https://github.com/leotm/react-native-template-new-architecture/commit/3f40bbeca4536a5c991e0151a7cf93b387fb9105
  • https://github.com/leotm/react-native-template-new-architecture/commit/447031e281cafb5d21c16226fcfa24244f8ad5e6
  • https://github.com/leotm/react-native-template-new-architecture/commit/a04b501b439b492c3c30423271dc0cba8ca64898
  • https://github.com/leotm/react-native-template-new-architecture/commit/f435cd05209af8af612214210314855da8888bdb

shouldn't be necessary to upg Yarn v3 -> v4 ๐Ÿค”

temp: revert commits in order

solution: difficult w/o commit hist since lockfile snapshot overwritten 5x

hack: delete yarn lockfile to remove Yarn v3 resolutions, then re-create with Yarn v4? but resolutions lost on devDeps

leotm avatar Jul 05 '22 13:07 leotm

follow-up attempt here: https://github.com/leotm/react-native-template-new-architecture/pull/846

leotm avatar Aug 16 '22 07:08 leotm

Raised in

  • https://github.com/leotm/react-native-template-new-architecture/issues/1181

Followed up in

  • https://github.com/leotm/react-native-template-new-architecture/pull/1205

leotm avatar Nov 16 '22 13:11 leotm