Questions tagged [yarn-v3]
33 questions
8
votes
1 answer
Why do resolutions get removed from package.json after running yarn install?
After upgrading to yarn 3, when I run yarn install, the resolutions are getting removed from package.json and added in yarn.lock file.
Are resolutions not supposed to reside in package.json when using yarn 3?

John Web
- 83
- 3
5
votes
0 answers
In yarn v3, how can we get list of only prod dependencies
I need to get a list of only prod dependencies with yarn 3. Could not find any option in official documentation for listing only prod or devDependencies.
Corresponding npm command is npm list --omit=dev
The available command to get list of all the…

newuser
- 76
- 4
3
votes
1 answer
Typescript linting errors on VSCode with Yarn v3.2.3
Whenever I intend to create react or the next app with the new yarn v3.2.3, my VS Code throws linting errors explaining in the picture below.
Mainly, the linter throws ts(2307) aka Cannot find module 'next' or its corresponding type…

Maruf Khan
- 80
- 7
2
votes
1 answer
Next.js with Yarn pnp in a mono repo keep failing when trying to build
I am running Next.js 13.0.5 with Yarn 3.2.1 and Lerna 5.6.1.
It seems like the main problem here is the build tool, because when I run the Next.js server itself (yarn dev) everything works perfectly.
What error am I getting?
Type error: Cannot find…

Yoni hodeffi
- 103
- 2
- 8
2
votes
1 answer
@types/node not recognised anymore after PnP loader mjs install
I have recently discovered Yarn 3 and so far I was quite happy with the PnP features. Since I mainly work with monorepos, I wanted to make use of Yarn workspaces. Unfortunately, I cannot get basic things to work. I have set up a test project to…

Flo Ragossnig
- 1,341
- 14
- 38
1
vote
0 answers
TypeError: The 'compilation' argument must be an instance of Compilation after yarn 3 update
I've been looking into this issue off an on for a few days and I can't find a good path forward.
First off I'm attempting to move our monorepo from yarn 1.22 to yarn 3 to increase dependency install speed. The migration steps outlined by yarn are…

TheGRS
- 103
- 8
1
vote
3 answers
How do I use Yarn version 3.5 on Github Actions? ("Error: cannot find module ... /yarn-3.5.0.cjs")
On our local machines, we've installed the latest version of Yarn for our node version of 16.17 per the instructions on the Yarn website:
corepack enable
corepack prepare yarn@stable --activate
We found this step was necessary to make it work…

Caleb Jay
- 2,159
- 3
- 32
- 66
1
vote
0 answers
`yarn global add remotedev-server` gives error `Usage Error: The 'yarn global' commands have been removed in 2.x - use 'yarn dlx' instead`
I am trying to run a local Dev build of Metamask Chrome Extension.
According to their README files Yarn3 should be installed and then to run React Dev Tools and Redux Dev Tools you to have install remotedev-server package with yarn global.
Yarn…

RevotronEngine
- 51
- 4
1
vote
0 answers
Is there a blanket way to change references to styles/scripts in node_modules when migrating to Yarn PNP?
I am attempting to migrate an existing project using Yarn with the node_modules linker to pnp, however in this project there are several references to things like stylesheets or scripts that would normally be stored in node_modules. Is there an…

MattC
- 31
- 2
1
vote
1 answer
Cannot find module or its corresponding type declarations in NestJs with Yarn 3
I created a NestJs app like this:
nest new .
The files were generated and run:
yarn
to install all dependecines.
Then run:
yarn start:dev
And here is the error:
src/app.controller.ts:1:33 - error TS2307: Cannot find module '@nestjs/common' or its…

jesusrlm
- 35
- 8
1
vote
1 answer
How to solve a version conflict using Yarn 3 resolution mechanism
I am trying to use React 17 in a codebase that previously used version 18 (because Mobx currently has partial support for 18 and I need to debug a CPU load issue), but this seems to result in a TS types version conflict.
The TS compiler tells me…

Thijs Koerselman
- 21,680
- 22
- 74
- 108
1
vote
1 answer
Why does yarn remove "private": "true", in my package.json?
When I run yarn in a directory that includes a package.json file with a "private": "true", field, this line is silently removed. This behavior is in yarn 3.1.0, but not in npm 8.5.5, for example.

Nuke
- 1,032
- 7
- 13
1
vote
0 answers
How to upgrade Yarn to latest version globally
Is there any way to upgrade Yarn to latest version i.e 3.x globally cause I only know how to upgrade Yarn to latest version in a repo only.

Shubh
- 11
- 2
1
vote
0 answers
What is the .yarn/berry/cache folder for when using Yarn 3?
I'm building a Docker image using Yarn 3 and I've noticed that on that image it creates two cache folders:
.yarn/cache
.yarn/berry/cache
Both appears to contain the same content (the .zip package files).
The first one, .yarn/cache, makes sense and…

laurent
- 88,262
- 77
- 290
- 428
0
votes
0 answers
Is there a way to override the same name `npmScopes` inside `.yarnrc.yml`?
Background
My organization has two registries of the same name (say my-org); one is public and is hosted via NPM, and the other one is private and hosted in GitHub. Unfortunately, there is no registry mirroring between the two, and internal packages…

aayani
- 333
- 9
- 19