Use this tag for version specific questions about Yarn version 2.x. Yarn is an open-source JavaScript package manager created by Facebook, Exponent, Google, and Tilde. When using this tag also include the more generic [yarnpkg] tag where possible.
Questions tagged [yarnpkg-v2]
192 questions
2
votes
1 answer
Can you use Yarn2 PnP "zero-installs" on a machine without Yarn?
I'm playing with Yarn 2's "zero install" stuff for a minor tool to address one of my boss's random allergies. (He takes umbrage at the expectation of having to run npm i on a cloned repo to make it work and insists putting node_modules into version…

millimoose
- 39,073
- 9
- 82
- 134
2
votes
1 answer
How can bundle a monorepo node project into a single file? trying with ncc
so I've got a tree something like
├── package.json
├── tsconfig.json
└── packages
├── lib1
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ └── tsconfig.json
├── lib2
│ ├── package.json
│ ├── src
│ …

xenoterracide
- 16,274
- 24
- 118
- 243
2
votes
1 answer
How to configure Yarn Berry, Eslint with GlobalCache in VsCode?
Is there a way to install EsLint with Yarn Berry with yarn option enableGlobalCache: true in VsCode ?
I installed the ESLint (dbaeumer.vscode-eslint) extension and all dependencies :
"devDependencies": {
"@babel/core": ">=7.12.0 <8.0.0",
…

Vincent
- 510
- 1
- 5
- 23
2
votes
0 answers
ts-jest disable babel, babel still appears to be running
So the docs say it should not be; but I'm seeing this output.
➤ YN0000: [@bb/graph]: [BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/services/services/.pnp.js as it exceeds the max of 500KB.
> yarn info -A…

xenoterracide
- 16,274
- 24
- 118
- 243
2
votes
2 answers
How do I downgrade from Yarn2 to Yarn1?
I'm using macOS and after installing Yarn2 several important tools no longer function. I've logged issues with them but in the meantime I need to get back to Yarn Classic. brew uninstall yarn and then tried brew install yarn@1.22.5 but this failed…

BillSaysThis
- 712
- 6
- 17
2
votes
1 answer
Yarn 2: `yarn version check` during CI always errors
When running yarn version check locally everything goes smoothly and reports issues correctly, however when our Github Action runs it we get the following error:
YN0001: UsageError: No ancestor could be found between any of HEAD and main,…

jjenzz
- 1,519
- 1
- 14
- 19
2
votes
2 answers
How to list and use packages in Yarn 2?
Since I'm a beginner with Yarn, therefore I have followed the current Yarn tutorial, and it describes Yarn 2. So I have installed Yarn 2. yarn --version command gives 2.0.0-rc.34.
But Yarn 2 seems to lack a command to show the list of the packages…

Kydesnic
- 21
- 1
- 4
2
votes
1 answer
Storybook 5.3 issue with yarn version 2
For a project requirement, I am configuring storybook 5.3 for react component development. I am using Yarn version 2 as the package manager.I've done all the steps mentioned in the storybook tutorial. but when starting the storybook using 'yarn…

vimal
- 23
- 5
1
vote
0 answers
How does Yarn install decide whether to throw YN0070 and use node_modules vs PnP?
I have 2 different branches in my project. When I do yarn install in one of them, it starts off with:
➤ YN0070: Migrating from Yarn 1; automatically enabling the compatibility node-modules linker
... then continues. This creates a .yarnrc.yml file…

Nathan Tew
- 432
- 1
- 5
- 21
1
vote
0 answers
Run Yeoman via `yarn dlx`
I am looking to dabble in VS Code extension development. Their documentation suggests using Yeoman to generate the base project. I use yarn as my Node package manager, so I need to use yarn dlx to run the command (yarn global installs are no longer…

dawsonc623
- 1,841
- 2
- 16
- 26
1
vote
1 answer
.pnp.cjs gets deleted when running yarn install
We have a project running with yarn PnP and things were running smoothly.
In my local machine, however, I must have done something wrong because now whenever I run "yarn install" the .pnp.cjs file and .pnp.loader.mjs are getting deleted.

Lucas
- 75
- 1
- 5
1
vote
0 answers
Prevent dev dependencies in Yarn 3 cache folder with PNP
I am utilizing Yarn 3 with the Plug'n'Play (PNP) feature for zero-installation of the dependencies in my development environment, which works well. However, when I run a production build, the .yarn/cache folder also includes dev-dependencies,…

ashish67
- 162
- 1
- 11
1
vote
1 answer
How to add package from sub-directory of monorepo with yarn
I have a fork of the expo monorepo that has changes in only one of the sub-packages (e.g. expo-speech). I want to import only that sub-package in my application. Given these parameters:
GitHub organization: my-org
Repo: expo
Branch:…

gabe
- 1,873
- 2
- 20
- 36
1
vote
0 answers
Why am i receiving so many warnings about peer dependencies when using Yarn?
I have just started using Yarn for the first time in a bare react native project. I started adding all dependencies that I need one-by-one. When I ran this one yarn add geofirestore, it showed many warnings after adding it:
Now, every time I run a…

showtime
- 1
- 1
- 17
- 48
1
vote
0 answers
How to set yarn version for a specific project
I have 2 projects which I need to run parallely on my local machine. Problem is, one of the project is using Yarn 3 and other one is using Yarn 1.
Steps given on Yarn's website https://yarnpkg.com/getting-started/install, sets the version globally,…

Mahesh
- 1,427
- 2
- 19
- 42