[Yarn] Install Yarn2
Posted answer1215
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Yarn] Install Yarn2相关的知识,希望对你有一定的参考价值。
This lesson goes over how to install yarn 2 through npm.
To install yarn 2 globally, we use
npm install -g yarn@berry
Init a project:
yarn init -y
To install yarn 2 to a specific project, we use
yarn policies set-version berry
This creates a .yarnrc
file and a .yarn/
directory. .yarnrc
that sets the path to our yarn instance in the created .yarn/
directory that holds our new yarn version.
以上是关于[Yarn] Install Yarn2的主要内容,如果未能解决你的问题,请参考以下文章
你可以在没有 Yarn 的机器上使用 Yarn2 PnP “零安装”吗?
从 npm 迁移到 Yarn 2 PnP:ts-loader 找不到 webpack