Migrate a JS Project to Yarn Berry
Kyle Schwartz

Kyle Schwartz @kylejschwartz

About: Software Developer @ Filogix

Location:
Toronto, Canada
Joined:
Nov 26, 2019

Migrate a JS Project to Yarn Berry

Publish Date: Dec 28 '21
4 0

For this tutorial, you will need a starting project. The assumption is that there is no lock file and the project is not installed (i.e. no node_modules folder). I will be starting with a blank Vite project. You can create one by running the command below and following the prompts:

yarn create vite
Enter fullscreen mode Exit fullscreen mode

If you don't have Yarn berry installed, run one of the following commands:

# Node >=16.10 - May have to run as admin
corepack enable
Enter fullscreen mode Exit fullscreen mode
# Node <16.10
npm i -g corepack
Enter fullscreen mode Exit fullscreen mode

Once completed, open the project. Now, run the following commands in sequence:

yarn set version berry
yarn
yarn dlx @yarnpkg/sdks vscode # If using vscode/vscodium
Enter fullscreen mode Exit fullscreen mode

All done!

Comments 0 total

    Add comment