-
Notifications
You must be signed in to change notification settings - Fork 35
guide yarn 2 support
Yarn v2 is a very different software from the v1. The following list contains the main new features:
Please, read them carefully to decide if your current project is suitable to use Yarn 2 as package manager.
❗
|
Some features are still experimental, so please do not use them in production environments. |
More info at https://yarnpkg.com/
Installing Yarn 2.x globally is discouraged as Yarn team is moving to a per-project install strategy. We advise you to keep Yarn 1.x (Classic) as your global binary by installing it via the instructions you can find here.
Once you’ve followed the instructions (running yarn --version from your home directory should yield something like 1.22.0), go to the next section to see how to enable Yarn 2 on your project.
Follow these instructions to update your current devon4ng project to Yarn 2:
-
Follow the global install instructions.
-
Move into your project folder:
cd ~/path/to/project
-
Run the following command:
yarn policies set-version berry # below v1.22 yarn set version berry # on v1.22+
-
Since Angular CLI still is not fully supported with the new Yarn architecture as it is not compatible with PnP it is necessary to include the
node-modules
plugin adding the following line in the.yarnrc.yml
file:nodeLinker: node-modules
-
Commit the
.yarn
and.yarnrc.yml
changes -
Run again
yarn install
.
ℹ️
|
For more advanced migration topics please refer to https://yarnpkg.com/advanced/migration |
If you’re using Zero-Installs:
.yarn/*
!.yarn/cache
!.yarn/releases
!.yarn/plugins
If you’re not using Zero-Installs:
.yarn/*
!.yarn/releases
!.yarn/plugins
.pnp.*
More details at https://yarnpkg.com/advanced/qa#details
This documentation is licensed under the Creative Commons License (Attribution-NoDerivatives 4.0 International).