DEV Community

Kyle Schwartz
Kyle Schwartz

Posted on

2

Migrate a JS Project to Yarn Berry

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!

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series