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
1
vote
1 answer
Yarn 2 root binaries unavailable in all workspaces
I've upgrade Yarn and now no workspace script such as yarn test will run without installing say jest in each workspace, or calling it with run -T jest. I am not finding much in the docs to support that installing binaries in workspace root is…

cyberwombat
- 38,105
- 35
- 175
- 251
1
vote
0 answers
How do I do a yarn link to a react-native-bob built module and have it work with Expo?
I created a library using react-native-builder-bob, if I publish or pack it I am able to use it on Expo as expected.
However, I want to test changes on my library without having to go through the publish/pack cycle.
I did:
yarn link on the library…

Archimedes Trajano
- 35,625
- 19
- 175
- 265
1
vote
0 answers
Timeout awaiting 'socket' for 60000ms with yarn install
I just upgraded yarn from 1.x.x to 3.2.1 (following applicable steps from https://yarnpkg.com/getting-started/migration), but now when I run yarn install it fails every time with the following error:
YN0001: │ RequestError: Timeout awaiting 'socket'…

Aaron Campbell
- 562
- 8
- 19
1
vote
0 answers
Scan package.json for deprecated packages?
If I go to a package like react-intercom on npmjs, it will display a deprecation warning right there on the page
This seems to be done through a command in npm called deprecate.
Is there a way to scan my package.json and find all packages where…

corvid
- 10,733
- 11
- 61
- 130
1
vote
1 answer
Yarn build using rollup hangs in docker build process
I am trying to create a docker image for a svelte application. The svelte application I am using is just the svelte template with TypeScript initiated. I have made no changes to the application itself, my only goal is to serve the svelte application…

Mabliz
- 31
- 4
1
vote
0 answers
After migrating to yarn 3 workspace "Cannot use import statement outside a module" running react-scripts test
I have a repository with yarn 3 workspaces and a CRA front end located in /packages/client
yarn workspace client start successfully launches the development app on port 3000.
The test suite ran correctly before moving the client to the packages…

Batters
- 729
- 1
- 7
- 19
1
vote
1 answer
yarn add command dosen't install package
I have very simple node project where I'd like to add dotenv package by yarn package manager. I'm working on linux Ubuntu 20.04.3 LTS. I'm typing command:
yarn add dotenv
The output is:
error An unexpected error occurred: "npm/dotenv: Invalid URI…

Krzysztof Michalski
- 791
- 1
- 9
- 25
1
vote
0 answers
Can "modern" Yarn add a dependency without a manifest?
In "classic" Yarn, you could add a dependency that did not have a package.json due to this pull: #3624.
Can "modern" Yarn (i.e. Yarn 2/3) do the same? I have failed to find any documentation about this. When I try I get an error:
yarn add…

adamk
- 115
- 9
1
vote
0 answers
Trading view library is not working on Production
i have used trading view charting library in react
its working perfect in development but in production its not working
when i used yarn build these warnings came in console but build successfully created
failed to parse source map from…

Noman
- 594
- 1
- 18
1
vote
0 answers
yarn create react-app not working and aborting installation
I tried installing a react-app using yarn and got this error message:
yarn version: 1.22.17
npm version: 8.3.0
It is also showing an error of "No Lockfile found".
$ yarn create react-app redux-shopping-app
yarn create v1.22.17
[1/4] Resolving…

Shubham Mittal
- 11
- 2
1
vote
1 answer
Can the Yarn 2 Constraints feature block the installation of a package?
I have a deep dependency tree. Some of the packages depend on nodejs packages that I don't need. Is it possible for Yarn 2 (berry) to skip those packages, i.e. not install them?
Yarn has a Constraints feature, but I don't know what's possible with…

Matthias
- 13,607
- 9
- 44
- 60
1
vote
0 answers
Get only production dependencies from .yarn/cache to build Docker image
I would to build a Docker image using multi-stage.
We are using yarn 2 and Zero installs feature which stores dependencies in .yarn/cache under zip format.
To minimize the size of my Docker image, I would like to only have the production…

Coulemelle
- 341
- 1
- 4
- 13
1
vote
1 answer
Yarn V2 (Berry) Workspaces with Peer Dependencies
I'm trying to switch to yarn workspaces, in V2 but keep getting an Invalid dependency range error for the new workspaces: syntax when used with peerDependencies
I've tried using an exact range, workspaces:* and carat syntax workspaces:^ with no…

Sampson Crowley
- 1,244
- 1
- 9
- 22
1
vote
0 answers
Yarn not recognizing built in package?
I have the following code snippet in my app:
import { createBrowserHistory } from 'history';
export default createBrowserHistory({ basename: '/dev' });
This function, and its typings, exist in node_modules under history and @types/history:
export…

Ronny Efronny
- 1,148
- 9
- 28
1
vote
2 answers
Create-react-app absolute imports don't work with yarn v2 workspaces + typescript
I'm using yarn v2 workspaces, and one of my workspaces is a frontend built with create-react-app / react-scripts. I want to enable absolute imports within the frontend app, so I can do things like import Button from 'components/Button' instead of…

Cam Jackson
- 11,860
- 8
- 45
- 78