-
-
Save internalfx/4f5b7f5d776a5eee5cec86f9418bf296 to your computer and use it in GitHub Desktop.
How to upgrade Yarn to Yarn 2 (Berry) seamlessly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.yarn/* | |
!.yarn/releases | |
!.yarn/plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Upgrade Yarn to Berry (latest Yarn 2 version known to Yarn 1) | |
yarn set version berry | |
# Upgrade Yarn Berry to latest version now that Yarn knows where to download it from | |
yarn set version latest | |
# (optional) Set nodeLinker to node-modules - this 100% guarantees backwards compatibility | |
yarn config set nodeLinker node-modules | |
# (optional) Adds `yarn upgrade-interactive` command back | |
yarn plugin import interactive-tools | |
# Reinstalls project using Yarn 2. This will also update your yarn.lock file, but will NOT sneakily upgrade the dependencies | |
yarn | |
# Commits the changes | |
git add . && git commit -m "Upgrade Yarn to Yarn Berry (v2)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment