Use this tag for version specific questions about Yarn version 3.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. More info here: https://dev.to/arcanis/yarn-3-0-performances-esbuild-better-patches-e07
Questions tagged [yarnpkg-v3]
35 questions
11
votes
3 answers
Not able to install Yarn through corepack
Environment: Windows, Node 16.18.0, Corepack 0.14.1
I am following these instructions to install Yarn.
When I run corepack prepare yarn@3.2.4 or corepack prepare yarn@3.2.4 --activate
I get the following error:
Preparing yarn@3.2.4... Internal…

aryan
- 130
- 1
- 8
9
votes
1 answer
How to install local package with Yarn v3?
I bashed my head against the wall trying to install a local package using Yarn v3. Here all the things I tried:
Run yarn add file:../hardhat-packager
Run yarn add ../hardhat-packager
Manually add "hardhat-packager": "file:../hardhat-packager" in…

Paul Razvan Berg
- 16,949
- 9
- 76
- 114
8
votes
2 answers
yarn set version not working. Can't change from yarn 3.0.0 to yarn 2.0.0
current yarn version is yarn 3.0.0.
Tried changing to yarn 2.0.0 using yarn set version 2.0.0-rc.30.
Even after that yarn version still remains at yarn 3.0.0.
Other alternatives I tried:
npm uninstall -g yarn then npm install -g yarn. Still yarn…

BiozterzCodes
- 165
- 1
- 10
7
votes
1 answer
Yarn 2/3 link via resolution for local development breaks staging
Just upgraded from Yarn 1 to Yarn 3.
In my package.json of my "Project 1" I have a dependencies to my published package
dependencies: {
...
"@my-package/name": "3.4"
...
}
With Yarn 1 not altering package.json when linking "Project 1" to…

retrovertigo
- 538
- 9
- 20
6
votes
1 answer
Why is "yarn 2" yarn 3.0.1?
Why did yarn not just call yarn 2 yarn 3 instead of calling it yarn 2?
% yarn --version
3.0.1
Or even call it berry? I don't understand the naming conventions.

Ilias Karim
- 4,798
- 3
- 38
- 60
5
votes
2 answers
command not found: if when running package.json script with Yarn v3 (berry)
I upgraded our projects yarn from v1.22 to v3.1.1. We use workspaces, so I have that plugin. Everything seems fine; other scripts work but when trying to use shell commands I get this error:
> yarn run start
command not found: if
command not found:…

Nick
- 4,901
- 40
- 61
5
votes
0 answers
How can I properly configure Yarn 2 PnP on a monorepo with TS References configured?
Short: For the project described below, how can I best configure things so that the two applications (client+server) run?
I am working on a longer running project that over time evolved into a mono repo. I cannot share the full code as the project…

Japser36
- 194
- 2
- 8
4
votes
1 answer
How to run a postinstall script after
I am migrating from yarn version 1.22 to yarn v3.2.3. I have a prepare script that was running automatically after install.
My prepare script generates some files (FIY Nuxt 3 generated files).
It does not run anymore on yarn 3, and how can I get the…

Lyokolux
- 1,227
- 2
- 10
- 34
4
votes
2 answers
Yarn install failing on GitHub Actions
We have a Yarn-based monorepo with the latest Yarn version 3.2.0. We are getting yarn install failures with zero debug logs on our GitHub Workflow:
Run yarn install
➤ YN0000: ┌ Resolution step
Resolution step
➤ YN0000: └ Completed in 1s
➤ YN0000: ┌…

rhlsthrm
- 769
- 1
- 12
- 23
4
votes
2 answers
How to use Yarn 2 (or 3) to run create-react-app without specifying a new directory?
I am trying to migrate from NPM to Yarn for the sole reason of getting rid of 'node_modules' folder.
I am trying to use CRA tool. However, on CRA it advises to use yarn create, which is not a command found in Yarn 2 documentation. After some…

mongonoob
- 103
- 1
- 5
3
votes
0 answers
How to login to codeartifact for a single project
I have the following structure:
nodejs_projects_directory
├ project_A
│ └ node_modules/codeartifact_dependencies
└ project_B
└ node_modules/npm_dependencies
I have to login to codeartifact to install the project_A…

VaibhavJoshi
- 355
- 2
- 15
3
votes
1 answer
yarn pnp fallback to default require
I'm writing some unit tests to check if my-module loads correctly a user-land module external-module:
const myMod = require('my-module')
myMod( { load: 'external-module' } )
Right now I'm having the error:
Your application tried to access…

Manuel Spigolon
- 11,003
- 5
- 50
- 73
3
votes
1 answer
Heroku not using cache for Yarn v3
Trying to get Heroku to use cached modules for Yarn v3 using workspaces. I have the following:
package.json:
"engines": {
"node": "16.x",
"yarn": "3.x"
},
"cacheDirectories": [
"node_modules",
"packages/components/node_modules",
…

orbiteleven
- 951
- 1
- 11
- 21
3
votes
2 answers
Fresh Nuxtjs install with yarn doesn't work
I simply create a new nuxt app using (following the documentation):
yarn create nuxt-app appname
Then I switch in to the directory and run (following the documentation):
yarn dev
And get the following error:
✖ Nuxt Fatal Error …

Edgars Vilums
- 131
- 8
2
votes
1 answer
Yarn: "Manifest not found" error when switching symlinks from "link:" to "file:" in package.json
I'm in the process of upgrading some infrastructure to Node 16 from 12. As part of this, npm was also upgraded.
Prior to the upgrade, I had a symbolic link in my package.json represented as link:./dist/src/shared
{
"name": "api",
"private":…

Alex von Brandenfels
- 1,608
- 15
- 25