Description
With the release of Yarn 2.0, many users may be interested in trying out the new version of the package manager with the Angular CLI. As of 9.0, the Angular CLI does not natively support Yarn 2.0 and its new package management strategy named Plug’n’Play (PnP). However, native support is currently and actively being investigated with several initial steps already in place. Native support is tentatively scheduled for inclusion in 10.0 or beyond with the goal of integrating new major versions of upstream dependencies that provide native support.
For those that are interested in experimenting with building applications using the new package manager, you can use the following instructions to workaround the current issues.
WARNING: This is not recommended for use with deployed applications and should not be used in a production environment.
- Install the workspace dependencies using Yarn 2.0
- Install the
pnpify
package:yarn add -D @yarnpkg/pnpify
- Unplug all Angular related packages including third-party libraries used within the application via
yarn unplug <package_name>
. This should include at a minimum all@angular
scoped packages. - If using the E2E command, the
webdriver-manager
package also needs to be unplugged:yarn unplug webdriver-manager
Once these steps are complete, Angular CLI operations such as serve or build can be used by executing yarn pnpify ng build
or yarn pnpify ng serve
, respectively.
Please note that manually running the ngcc
command with or without the pnpify utility does not currently work.
If any issues are encountered using the workaround steps or for Yarn 2.0 in general, please open a separate issue detailing the problem.