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
0
votes
1 answer
.yarnrc private registry authentication with username and password
The instructions on how to migrate to Yarn 2 are unclear, and it's not obvious how to authenticate to a private registry which uses a username and password.
Here's the contents of my .npmrc…

Harry
- 187
- 2
- 10
0
votes
0 answers
yarn begin error Command failed with exit code 1
Tried to use yarn begin, but errors keep showing up
PS C:\Users\obi besong\Desktop\appC> yarn begin
yarn run v1.22.17
$ react-scripts start
C:\Users\obi besong\Desktop\appC\node_modules\queue-microtask\index.js:5
?…

Ojage S
- 71
- 1
- 9
0
votes
1 answer
Errors under Jest in CRA using Yarn portal
I have a Create-React-App 5 project using Yarn 3 and TypeScript 4. The web app uses a library in the same repo through Yarn's portal: protocol (Yarn workspaces are not used).
myRepo
├── myLib
│ ├── package.json
│ ├── yarn.lock
│ └── src
│ …

usethe4ce
- 23,261
- 4
- 30
- 30
0
votes
1 answer
React Native : BUILD FAILED after doing "yarn ios"
I cloned a React Native app from github and followed the instructions in the Readme file (yarn install; cd ios && pod install). The app was built successfully in Xcode, but when i try to run it from my terminal using yarn ios the build failed.
The…

bilalo
- 129
- 1
- 1
- 7
0
votes
1 answer
Node-Saas error on installation on my personal project
I tried to add node-sass to my project using yarn add node-sass, but I am getting this error can anyone help
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/7] ⠄ waiting...
[-/7] ⠄ waiting...
[7/7]…

agoumi
- 304
- 5
- 24
0
votes
1 answer
How to set yarn version configs in yarn2+?
I am moving my project from yarn1 to yarn2+.
I'm using yarn to bump the versions of the packages in a monorepo and setting config version options with a command e.g. yarn config set version-git-message in my ci pipeline.
However, with yarn2+ I am…

rakitin
- 1,943
- 6
- 25
- 51
0
votes
1 answer
yarn berry foreach workspaces not building packages in order specified in package.json
In Yarn 1, yarn workspaces run build would use the order specified in the workspaces field of the package.json file to build each package.
For example, if I had the order specified like this:
"workspaces": {
"packages" [
"packages/c",
…

dagda1
- 26,856
- 59
- 237
- 450
0
votes
1 answer
Is there any difference between "4.3.5-pnpify" and "4.3.5-sdks"?
After I run
yarn dlx @yarnpkg/sdks vscode
typescript workspace version changed
from
4.3.5-pnpify
to
4.3.5-sdks
when I ran
yarn dlx @yarnpkg/pnpify ....
It did not work, because it had deprecated.
My yarn version is 2.4.1
Is there any important…

djangoboi
- 28
- 4
0
votes
1 answer
How to list every public workspace with Yarn 2+?
I'm trying to recreate lerna's list functionality with Yarn 2, I need to get a list of every public package's name in the workspace. yarn workspaces list can list all the packages on the workplace, but it returns every package, private…

sydd
- 1,824
- 2
- 30
- 54
0
votes
2 answers
tsc cannot find declaration files of express in apollo-server when using yarn workspaces
I am trying to build a monorepo with yarn workspaces (version 3.0.2), typescript(4.4.3) and apollo-server (3.3.0) in one of those packages. When running yarn workspace graphql tsc --build I get the following error:
Could not find a declaration file…

Bene
- 1,251
- 6
- 19
- 34
0
votes
1 answer
How do I get yarn 2 to work in my project?
I cd into my project and run yarn set version berry. It creates the .yarnrc.yml with the yarnPath variable. However, if I do run yarn inside the dir it still defaults to the old Yarn. I made a Makefile with commands like…

Loai Misto
- 13
- 1
- 1
0
votes
1 answer
Why is Mocha not working with Yarn Berry?
I'm trying to do a very simple test using mocha (no config files, no additional flags, just mocha, yarn2, and testee.js file), but it always give me 0 passing. Hell, it won't even run any file!
// testee.js
console.log('test') // No…

SnekNOTSnake
- 1,157
- 12
- 24
0
votes
0 answers
Run a set of yarn commands sequentially in a node script
I want to use yarn commands sequentially and run it in a node script, in the intermediate steps, and mix it with js as needed. For example
yarn audit > out.json
//some file reading, processing, and storage
for(i = 0; i < libs.length; i++) {
…

Ganga
- 597
- 2
- 9
- 23
0
votes
1 answer
Migration from npm to Yarn 2 PnP: ts-loader doesn't find webpack
I am working on a NestJS project.
Until now I have used npm. Now I want to migrate to Yarn 2 with Zero-Install an P'n'P.
However, after following the migration instruction, I get this error:
~/IdeaProjects/service on feature/yarn-migration ⇡3 ❯ yarn…

Harold L. Brown
- 8,423
- 11
- 57
- 109
0
votes
1 answer
Testcafe won’t run with Yarn 2
Testcafe 1.10 doesn’t seem to run via Yarn 2, while it just works running the globally installed one manually. I get this output:
ERROR Error: testcafe-legacy-api tried to access read-file-relative, but it isn't declared in its dependencies; this…

sylbru
- 1,461
- 1
- 11
- 19