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
1 answer

Do I have to fix audit issues of the latest nuxt.js?

I am trying to use nuxt for my app, but when I run "yarn audit", there are some audit issues which are dependencies of nuxt. Do I have to fix these audit issues? And if I have to, how can I fix it? I am using nuxt 2.15.7 and I added the latest…
spacekoki
  • 127
  • 1
  • 9
2
votes
0 answers

How to fix Jest error - Test suite failed to run

I have a project which works with React, TypeScript, Next.js and Jest using yarn. If I try to test, it fails with the following error message. FAIL src/components/Dashboard/Report.test.tsx Test suite failed to run Your application tried to…
hotcakedev
  • 2,194
  • 1
  • 25
  • 47
2
votes
1 answer

Is there a cross-platform way to get the name of the parent process in Node.js?

I'm working on an npm package initializer, that is, a program that runs when the user runs the npm init command. npm is not the only package manager for Node.js any more, yarn is also quite popular and pnpm is a personal…
cyco130
  • 4,654
  • 25
  • 34
2
votes
0 answers

Development only workspace

I am planning to split some of the code in my project to NPM/Yarn workspaces. But some of the workspaces will be used only during development. Just to be clear, I am not referring to devDependencies for the workspace. The workspace itself is a…
Joyce Babu
  • 19,602
  • 13
  • 62
  • 97
2
votes
0 answers

Yarn cache clean freezes and gets killed?

> yarn cache clean --verbose yarn cache v1.22.5 verbose 0.214901496 Checking for configuration file "/var/www/foo/.npmrc". verbose 0.215859508 Checking for configuration file "/usr/local/share/.npmrc". verbose 0.216425682 Checking for configuration…
Leo Jiang
  • 24,497
  • 49
  • 154
  • 284
2
votes
1 answer

yarn test fails with jasmine-ts yargs dependency

I am running yarn test to run my tests. I had to update some versions in my package.json file beforehand, so I deleted the yarn.lock file. Before removing the yarn.lock file, the tests pass just fine. Now, the tests fail with this error: TypeError:…
johnny_mac
  • 1,801
  • 3
  • 20
  • 48
2
votes
0 answers

Yarn does not work in WSL when I change the directory

I've recently downloaded WSL on my system as well as Ubuntu 20.04 LTS. I installed Node JS on it and it seems to work fine. But when I tried installing yarn from the following command: curl -o- -L https://yarnpkg.com/install.sh | bash It installed…
2
votes
0 answers

Cannot run a nuxt project

I took over a project from an other company and now I am having some trouble to run their application on my PC. When I run yarn run dev, I do have the following error nuxt-ts:2 basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") What can I do,…
tinmi
  • 21
  • 1
2
votes
1 answer

Cannot find ./Page - Field 'browser' doesn't contain a valid alias configuration storybook

I'm currently setting up a create-react-app monorepo with storybook using Yarn Workspaces V1.22. The repository is clean,(just bootstrapped a create-react-app) and no further modifications were performed. In fact, it was initialized with npx sb…
Jose A
  • 10,053
  • 11
  • 75
  • 108
2
votes
0 answers

Blockchain (Avalanche) faucet implementation in the local test network

I am trying to implement a faucet for my local testnet which consists of 5 node. To do that I followed the avalances github documentation as in the link, https://github.com/ava-labs/avalanche-faucet In short, basically, I run my 5 nodes and all…
monir zaman
  • 309
  • 1
  • 3
  • 13
2
votes
1 answer

How to deal with yarn's `.pnp.js` merge conflicts?

Using yarn 2's new plug n play (pnp) creates a long .pnp.js file. I get a bunch of merge conflicts while pulling, and these are not autofixed (unlike yarn.lock). How are these conflicts solved? I'd rather not go them through manually as it's not…
Gabriel Petersson
  • 8,434
  • 4
  • 32
  • 41
2
votes
1 answer

Can't resolve element-icons.woff and .ttf in node_modules

I have a StoryBook implementation on my app. In the app itself the fonts load, but in StoryBook I get an error when I try to import them. How can I solve this? Error: in…
Potato55
  • 31
  • 3
2
votes
2 answers

How to fix errors in Gridsome.js?

Problem Summary So I'm trying to launch a new Gridsome project for local development. I've toyed with Gridsome in the past and had a great experience, so I decided to give it another shot. This time around; however, when I run the gridsome create…
buildpax
  • 340
  • 3
  • 9
2
votes
2 answers

NPM insists on CodeArtifact, even on public registry

I'm using npmrc to setup my corporate (using CodeArtifact) and public (using registry.npmjs.org) NPM registries. The problem is that, even with the public profile selected, I keep getting an error that the authentication to CodeArtifact is missing.…
Mauricio Klein
  • 527
  • 2
  • 12
2
votes
1 answer

Docker not installing node_modules with yarn

I am running a Ruby on Rails app with Webpacker using Yarn and trying to run this on Docker via Docker Compose. When I run docker compose build it looks like it runs successfully, but the node_modules folder is nowhere to be found and I can't use…