Questions tagged [yarnpkg]

This tag is for Yarn v 1.x. See version-specific tags, as version differences are significant. Yarn is an open-source JavaScript package manager. With Yarn, engineers have access to the npm registry and can install packages quickly, and manage dependencies consistently across machines or in secure offline environments.

Yarn is a fast, reliable and secure package manager for Node.js and JavaScript projects, which is compatible with the npm package registry. It aims to avoid the issues caused by npm, such as non-deterministic installations, complex dependency trees, and unreliable package combinations.

Yarn takes inspiration from Cargo, the Rust package manager, and Bundler, a Ruby tool.

The majority of packages created with npm (version 3) should be compatible with Yarn and the node_modules directory produced should satisfy all dependencies.

When should I use ?

Use when your question directly relates to Yarn. Questions about package installation issues, or Yarn's performance are in the scope of this tag and are welcome under .

Don't tag questions just because you use Yarn in your project when it's clearly not relevant to the core of your question. For example, "Why doesn't this if statement work?" is off-topic for this tag even if you used Yarn to set it up. Consider or instead for these questions.

Useful References

Comparison of npm and Yarn commands

  • yarn add = npm install --save
  • yarn global add = npm install --global
  • yarn ls = npm ls
4134 questions
2
votes
0 answers

Ignore webpack-cli v4 from dependabot updates and keep v3.x

Due to private packages, I am still using Dependabot v1. Below is my javascript (yarn) config. version: 1 update_configs: - package_manager: 'javascript' directory: '/' update_schedule: 'daily' version_requirement_updates:…
Dennis
  • 1,805
  • 3
  • 22
  • 41
2
votes
2 answers

installing yarn with brew

First using brew, I installed current node LTS which is node@14 right now Then I symlinked node using brew link --force node@14 since LTS versions are keg-only Then I installed yarn with brew install yarn but for some reason brew installed node@15…
2
votes
0 answers

How to nicely include a private NPM dependency in a lerna workspace project?

To preface, the project is using lerna with yarn workspaces and we are pulling in an internal NPM package from our private npm registry (not hosted with npm). I currently understand how .yarnrc and .npmrc files can authenticate to private registries…
2
votes
2 answers

Install dev dependency at root with NPM workspaces and Lerna

So with the release of NPM 7.0.0, I am trying to figure out how to use NPM instead of Yarn Workspaces with Lerna. In Yarn it is possible to do yarn add packageName --dev -W to add the dependency to the root level package.json. How can I do that with…
AngularDebutant
  • 1,436
  • 5
  • 19
  • 41
2
votes
1 answer

Can I use a custom node_modules path with create-react-app

I'm working on a project inside a VM (really docker on windows via vscode remote-containers). I would like to avoid building my react app at $(pwd)/node_modules, because everything under $(pwd) is synced to my windows file system which causes…
spanishgum
  • 1,030
  • 1
  • 14
  • 29
2
votes
0 answers

How to install zookeeper node module offline?

I've been trying to install zookeeper node module offline (behind corporate walls). Usually, I use this script to download modules, and then publish it (and all it's dependencies) to verdaccio in my closed network - and it works. With zookeeper, it…
Liza Talis
  • 181
  • 1
  • 1
  • 5
2
votes
1 answer

How can bundle a monorepo node project into a single file? trying with ncc

so I've got a tree something like ├── package.json ├── tsconfig.json └── packages ├── lib1 │   ├── package.json │   ├── src │   │   ├── index.ts │   └── tsconfig.json ├── lib2 │   ├── package.json │   ├── src │  …
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
2
votes
1 answer

How to configure Yarn Berry, Eslint with GlobalCache in VsCode?

Is there a way to install EsLint with Yarn Berry with yarn option enableGlobalCache: true in VsCode ? I installed the ESLint (dbaeumer.vscode-eslint) extension and all dependencies : "devDependencies": { "@babel/core": ">=7.12.0 <8.0.0", …
Vincent
  • 510
  • 1
  • 5
  • 23
2
votes
1 answer

Yarn seems to not download all files of a package

I run into an odd problem. We have 3 microservices in our project, and all of them are using exceljs lib. In two of them, yarn does download all the needed files of this package. In the third one, it is missing the dist/es5/doc folder. Version is…
2
votes
1 answer

Common dependency lib version with yarn workspaces

Assuming I have an external NPM lib dependency that is shared among different workspaces, is it possible to set a single version for all dependant workspaces? What if this dependency is a peer or dependency ? e.g // external-lib-dep in…
Royi Freifeld
  • 629
  • 2
  • 11
  • 31
2
votes
0 answers

ts-jest disable babel, babel still appears to be running

So the docs say it should not be; but I'm seeing this output. ➤ YN0000: [@bb/graph]: [BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/services/services/.pnp.js as it exceeds the max of 500KB. > yarn info -A…
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
2
votes
0 answers

Sass-loader issue in production environment

I am using rails as back-end and vue.js as front-end. Whenever I try to build an image in production it fails and throws errors. Module not found: Error: Can't resolve 'sass-loader' warning " > vue-loader@15.9.3" has unmet peer dependency…
susie
  • 163
  • 2
  • 17
2
votes
1 answer

Webpack-cli - TypeError: Cannot convert undefined or null to object

I'm trying to build yarn build but i'm having the following error yarn run v1.22.4 $ webpack --progress --config resources/assets/build/webpack.config.js \wp-content\themes\portfolio\node_modules\webpack-cli\bin\cli.js:93 …
MelbDev
  • 355
  • 1
  • 5
  • 12
2
votes
1 answer

Sapper/Svelte/Rollup external dependencies best practice?

Smart people! I’m a bundler-beginner with a bundler slash dependency-question. On yarn dev run I get the error: "Cannot find module '@sveltejs/svelte-scroller'..." I have a sapper/svelte/rollup/yarn-suite the svelte-scroller-plugin The plugin is…
Kiiim
  • 23
  • 4
2
votes
1 answer

Build failed for AWS Amplify React Site for unknown reason

TL;DR: I can't tell why my React app is failing the build on AWS Amplify. Hello! I am new to deploying with AWS Amplify and needed some help demystifying the below logs. # Starting phase: preBuild …
Willy
  • 322
  • 1
  • 17