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
551
votes
9 answers

Should I commit the yarn.lock file and what is it for?

Yarn creates a yarn.lock file after you perform a yarn install. Should this be committed to the repository or ignored? What is it for?
rlay3
  • 10,002
  • 6
  • 30
  • 22
462
votes
5 answers

How to clear cache in Yarn?

I am doing some benchmark tests for Facebook's Yarn. For this, I need to clear my global Yarn cache. Is there a command available for this? I have force-removed my ~/.yarn-cache folder, but this seems to be quite manual.
nikjohn
  • 20,026
  • 14
  • 50
  • 86
428
votes
24 answers

Yarn install command error No such file or directory: 'install'

I am installing sylius bundle and while install sylius I need to run yarn install So While I run the command: yarn install I get the error: ERROR: [Errno 2] No such file or directory: 'install'
Ricky ponting
  • 4,537
  • 4
  • 13
  • 26
327
votes
24 answers

The engine "node" is incompatible with this module

I am getting below yarn error when deploying to AWS error fs-extra@7.0.1: The engine "node" is incompatible with this module. Expected version ">=6 <7 || >=8". Got "7.0.0" Any idea how will this be resolved? Will this work out if I specify engine…
JN_newbie
  • 5,492
  • 14
  • 59
  • 97
323
votes
6 answers

What is the closest to `npm ci` in yarn

In npm, there's a ci command for installing the project with a clean state. In the documentation, it is claimed that: It can be significantly faster than a regular npm install by skipping certain user-oriented features. It is also more strict than…
shabunc
  • 23,119
  • 19
  • 77
  • 102
310
votes
32 answers

'TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined'

I'm working on a project in React and ran into a problem that has me stumped. Whenever I run yarn start I get this error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined I have no idea why this…
274
votes
32 answers

error /node_modules/node-sass: Command failed

When I tried install vue store front in my local but when I tried "yarn install" command I get following error. How can I solve this error? How can I solve this error? error /var/www/html/vue-storefront/node_modules/node-sass: Command failed. Exit…
Adil
  • 3,241
  • 3
  • 11
  • 9
247
votes
6 answers

"You are running create-react-app 4.0.3 which is behind the latest release (5.0.0)"

I got an error while creating a React application. How do I fix it?
Athif Saheer
  • 4,539
  • 3
  • 9
  • 14
244
votes
24 answers

Yarn: How to upgrade yarn version using terminal?

How should yarn be upgraded to the latest version?
Janaka Pushpakumara
  • 4,769
  • 5
  • 29
  • 34
244
votes
30 answers

How do I uninstall Yarn?

How can I uninstall yarn? I've used it for a react-native project and now whenever I move the code out of index.ios.js or index.android.js it throws an error so I'd like to just use npm but whenever I initialize a react-native project it defaults to…
maxwellgover
  • 6,661
  • 9
  • 37
  • 63
238
votes
7 answers

How to install package from github repo in Yarn

When I use npm install fancyapps/fancybox#v2.6.1 --save, so fancybox package at v2.6.1 tag will be installed. This behavior is described in docs I want to ask, how to do this with yarn? Is this command the right alternative? In yarn docs isn't…
Silver Zachara
  • 2,901
  • 2
  • 16
  • 22
226
votes
27 answers

Yarn - There appears to be trouble with your network connection. Retrying

I have been trying to do the quickstart guide for react native, but kept getting this error There appears to be trouble with your network connection. Retrying... My connection works just fine.
t-doog
  • 2,275
  • 2
  • 8
  • 5
201
votes
15 answers

Yarn global command not working

I'm working with Yarn v0.16.1. If I understand correctly (according to the documentation), yarn global add should be the equivalent of npm install -g . However, when I run the example in the docs (with create-react-app), the…
jaredsk
  • 2,617
  • 2
  • 18
  • 18
195
votes
6 answers

When to use Yarn over NPM? What are the differences?

What are the differences between Yarn and NPM? At the time of writing this question I can only find some articles on the Internet showing what's the Yarn equvalent of an NPM command like this. Do they have the same functionalities (I know Yarn does…
Asha
  • 3,871
  • 7
  • 44
  • 57
190
votes
4 answers

How to install package with local path by Yarn? It couldn't find package

In my package.json I'm pointing local package my-custom-i18n by its relative path: package.json "dependencies": { "core-js": "^2.4.1", "my-custom-i18n": "./../MyProject.Shared/myproject-i18n", "rxjs": "5.0.0-beta.12", ... } npm install installs…
michalczukm
  • 9,963
  • 6
  • 40
  • 47
1
2 3
99 100