Questions tagged [yarnpkg-v2]

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.

192 questions
7
votes
0 answers

yarn link and production build

We are using yarn link to refer to internal packages to speedup the dev workflow which has been helping great since we don't have to publish for each change. However, when we want to create a production build using yarn install --prod, it is not…
metasync
  • 338
  • 1
  • 10
7
votes
1 answer

How to use registry scopes with Yarn 2.0 and Azure Artifacts

I would like to use https://registry.yarnpkg.com as my package registry for all packages except 1 that I am hosting on Azure Artifacts. I have the following .yarnrc.yml file yarnPath: ".yarn/releases/yarn-berry.js" npmScopese: my-scope: …
Tim
  • 181
  • 2
  • 5
7
votes
1 answer

Making a dependency's dependencies available with Yarn 2

I'm working on a framework where I want the dependencies of the framework package to be available to the application which consumes it. The dependencies are not directly used by the consumer, but by the files provided by the framework. With npm, it…
JakeDK
  • 966
  • 1
  • 9
  • 18
6
votes
1 answer

Need help setting up eslint in a monorepo using Yarn 3 and TypeScript

I've been scratching my head non stop trying to setup an ESlint configuration in my monorepo. I'm using Yarn 3.2.4 as the package manager. Here is a GitHub repo containing an example project.. Here is the project structure : /monorepo ├── /configs │…
souyahia
  • 200
  • 1
  • 9
6
votes
1 answer

How to identify which version of Yarn is used by a project?

For the OSS Review Toolkit project, I would like to identify which version of yarn is used by a given project in a given repository. Which criteria should be used ? There is: package.json/packageManager which requires Corepack and may not be used…
Nicolas Nobelis
  • 772
  • 6
  • 10
6
votes
0 answers

Run script before installing packages with nodeLinker set to node-modules

I have to run a script (from my package.json file) before I run yarn install. The script sets up the configuration for a private package. In my .yarnrc.yml, I have nodeLinker: node-modules (and I want to keep it that way because I get other errors…
Nate
  • 7,606
  • 23
  • 72
  • 124
6
votes
1 answer

Should i push the .yarn/cache folder to Github - Yarn2

I recently upgraded to Yarn2 and added the following to my .gitignore .yarn/* !.yarn/cache !.yarn/releases !.yarn/plugins !.yarn/sdks !.yarn/versions I still use nodeLinker: node-modules, however when I push my code, I am pushing the .yarn/cache…
arunmmanoharan
  • 2,535
  • 2
  • 29
  • 60
6
votes
3 answers

Within in a monorepo, is it possible to configure a package to 'use the uncompiled code if you can'?

I'm playing around with Yarn 2, and I want to do something like this. I have a monorepo of the structure: / packages/ shared-ts/ package.json src/ lib*/ app-ts/ package.json src/ lib*/ …
dwjohnston
  • 11,163
  • 32
  • 99
  • 194
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
6
votes
0 answers

Issue with yarn's lockfile being modified

I'm using yarn berry, specifically version 3.0.0, but was also having the same issue with 2.4.2. When I run yarn install --immutable in CI I get the error: [2021-07-27T04:51:41Z] ➤ YN0028: │ The lockfile would have been modified by this install,…
n00b
  • 5,843
  • 11
  • 52
  • 82
6
votes
0 answers

How do I import a React library from one Yarn workspace into another when hoisting is disabled?

I'm using Yarn v2 (berry) to manage a monorepo with the following structure: project-root /packages react-native-app (dependencies: my-hooks-lib, react@17.0.1) my-hooks-lib (dependency: react@17.0.1) Here's my…
glocore
  • 1,727
  • 1
  • 14
  • 24
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
5
votes
1 answer

Difference between yarn versions

I've been using yarn 1.x for a while, installed with npm. Today, I wanted to use a plugin, which, after some research propted me to install something like yarn 3.x. I had no idea that there are other supported versions of yarn. To be honest, now I'm…
TDiblik
  • 522
  • 4
  • 18
5
votes
3 answers

Getting errors when patching a npm package

when I patch a dependency like this: package.json: "dependencies": "react-native-webview": "patch:react-native-webview@11.0.3#scripts/patches/react-native-webview+11.0.3.patch", ... patches/react-native-webview+11.0.3.patch: diff --git…
flaviut
  • 2,007
  • 3
  • 23
  • 32
5
votes
2 answers

Using Yarn 2 (Berry) for packaging application in a Docker image

I'm migrating a VueJS application from "classic" Yarn 1.x to Yarn 2. Following the install documentation is straightforward and works without problems. The tricky part comes when packaging the application in a Docker image. Current Dockerfile FROM…
Robert Strauch
  • 12,055
  • 24
  • 120
  • 192
1
2
3
12 13