Skip to main content

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.

Filter by
Sorted by
Tagged with
584 votes
9 answers
262k views

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's user avatar
  • 10.3k
493 votes
5 answers
415k views

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 ...
nikjohn's user avatar
  • 21.1k
452 votes
25 answers
452k views

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's user avatar
366 votes
26 answers
551k views

The engine "node" is incompatible with this module

I am getting below yarn error when deploying to AWS: error [email protected]: The engine "node" is incompatible with this module. Expected version ">=6 <7 || >=8". Got "...
JN_newbie's user avatar
  • 5,902
363 votes
6 answers
164k views

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 ...
shabunc's user avatar
  • 24.3k
324 votes
26 answers
420k views

'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 ...
Fredrick Barrett's user avatar
306 votes
34 answers
410k views

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-...
Adil's user avatar
  • 3,581
263 votes
24 answers
348k views

Yarn: How to upgrade yarn version using terminal?

How should yarn be upgraded to the latest version?
Janaka Pushpakumara's user avatar
262 votes
31 answers
561k views

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 ...
maxwellgover's user avatar
  • 7,021
250 votes
6 answers
117k views

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

I got an error while creating a React application. How do I fix it?
Athif Saheer's user avatar
  • 4,607
248 votes
7 answers
213k views

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 ...
Silver Zachara's user avatar
241 votes
31 answers
303k views

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's user avatar
  • 2,425
214 votes
7 answers
63k views

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 equivalent of an NPM command. Do they have the ...
Asha's user avatar
  • 4,101
210 votes
15 answers
297k views

Yarn global command not working

I'm working with Yarn v0.16.1. If I understand correctly (according to the documentation), yarn global add <package> should be the equivalent of npm install -g <package>. However, when I ...
jaredsk's user avatar
  • 2,706
204 votes
12 answers
256k views

Yarn - How do I update each dependency in package.json to the latest version?

I have a react app with deprecated dependencies. To make it work, I have to update the dependencies to their newer (but stable) versions. As per this stakoverflow thread, to update dependencies in ...
DevLoverUmar's user avatar
  • 13.4k
201 votes
4 answers
213k views

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": "...
michalczukm's user avatar
  • 10.3k
188 votes
15 answers
224k views

Module not found: Error: Can't resolve 'core-js/es6'

I've got a problem with my build process in relation to my React app. I always get the following error: Module not found: Error: Can't resolve 'core-js/es6' if I use this in a polyfill.js: import '...
Gutelaunetyp's user avatar
  • 2,092
179 votes
15 answers
99k views

error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?

My problem seems similar to this issue, except it happens when I run yarn install in a rails app. When I run yarn install, it runs successfully for some time, then ../src/libsass/src/ast.hpp:1614:25: ...
stevec's user avatar
  • 48.3k
179 votes
7 answers
121k views

Should I commit yarn.lock and package-lock.json files?

We're using yarn for all our deterministic pkg installations but don't prevent the user from using npm - I'm guessing having both these files will cause issues however. Should one be added to your ....
BisonAVC's user avatar
  • 2,040
177 votes
5 answers
177k views

npm equivalent of yarn resolutions?

Is there an npm equivalent of the yarn resolutions functionality? There is no mention of it in the npm package.json docs. For example, I want to install [email protected] and one of its dependencies (@lerna/...
adanilev's user avatar
  • 3,268
169 votes
19 answers
328k views

Support for the experimental syntax 'jsx' isn't currently enabled

I'm trying to run very simple code, but I'm getting an error, I didn't use the create react app! It looks like my babel.config.js file is being ignored! This is the structure of my small project: My ...
Manzini's user avatar
  • 1,921
163 votes
3 answers
127k views

What is the equivalent of "npm install <package_name> --save" in Yarn?

I am using Yarn to install the dependencies of my project. What is the equivalent of "npm install <package_name> --save " in Yarn to update the entry in my package.json file? I can use ...
Manivannan's user avatar
  • 3,204
161 votes
4 answers
74k views

How do you resolve Git conflicts in yarn.lock

When multiple Git branches modify the dependencies in a project that uses Yarn, it is likely to introduce a conflict in the yarn.lock file. It is not a good idea to delete and regenerate the yarn.lock ...
Christian Schlensker's user avatar
153 votes
2 answers
105k views

Run yarn in a different path

Is there a way to specify a working directory for yarn? This would be different then the --modules-folder option. Specifically, I'm trying to run the yarn install command from a location outside of ...
mrbnetworks's user avatar
  • 2,617
146 votes
3 answers
103k views

How do I override nested dependencies with `yarn`?

If my package has these dependencies { "name": "my-package", "dependencies": { "foobar":"~1.0.3", "baz":"2.0.9" } And the foobar package has these dependencies { "name": "foobar", "dependencies"...
Chris W.'s user avatar
  • 38.7k
145 votes
3 answers
100k views

What does 'has unmet peer dependency' mean when installing a package with yarn?

I have a fresh install of yarn (via npm install yarn -g) and tried to install a few packages with yarn add vue-loader babel-loader style-loader css-loader file-loader webpack I then got a few ...
WoJ's user avatar
  • 29.1k
144 votes
3 answers
173k views

How to update package-lock.json without doing npm install?

Question What is the way to update/generate package-lock.json without making a real installation of node_modules (what npm install does)? I want just a valid package-lock.json based on my package.json,...
S Panfilov's user avatar
  • 17.3k
142 votes
12 answers
125k views

Yarn ERROR: There are no scenarios; must have at least one

I tried to install Yarn and when I used the yarn command I got: 00h00m00s 0/0: : ERROR: There are no scenarios; must have at least one. my yarn --version is 0.32. Why doesn't it work?
Francesco Borzi's user avatar
142 votes
9 answers
154k views

Why is WSL extremely slow when compared with native Windows NPM/Yarn processing?

I am working with WSL a lot lately because I need some native UNIX tools (and emulators aren't good enough). I noticed that the speed difference when working with NPM/Yarn is incredible. I conducted a ...
WrRaThY's user avatar
  • 1,868
138 votes
12 answers
100k views

is there a yarn alternative for npm audit?

need pinned resolution feature of yarn, but also want to audit with npm audit? Is there a yarn alternative to npm audit? Or, alternately, will pinning resolutions of dependencies of dependencies work ...
sjt003's user avatar
  • 2,537
137 votes
3 answers
86k views

When installing packages with Yarn, what does "incorrect peer dependency" mean?

I've just cloned a repo, which recommends the use of Yarn to install dependencies. When I run yarn install, it seems to be okay, but it provides this warning: yarn install v0.20.3 [1/4] 🔍 Resolving ...
shrewdbeans's user avatar
  • 12.3k
129 votes
6 answers
161k views

How to ignore incompatible engine "node" error on installing npm dependencies with yarn?

Given this package.json: { "name": "yarn-install-fail", "version": "1.0.0", "description": "", "main": "index.js", "scripts": {}, "author": "", "license": "ISC", "dependencies": { ...
k0pernikus's user avatar
  • 64.7k
126 votes
8 answers
248k views

How do I force Yarn to reinstall a package?

My project has a dependency that I sometimes get from a package server and sometimes get from a local copy I have on my machine. As a result, I frequently need to have Yarn switch where it looks for ...
Kevin's user avatar
  • 15.6k
120 votes
10 answers
162k views

I have a "license" in my package.json, why is npm/yarn saying it is missing?

On running yarn install I see a warning every time that there is no license filed even though I have defined one: $ jq . package.json { "name": "license-example", "version": "1.0.0", "main": "...
k0pernikus's user avatar
  • 64.7k
117 votes
2 answers
144k views

Node engine 8.x or 10.x in package.json

I tried to specify the node engine in a package.json to accept both 8 and 10 version. I tried to type this: "engines": { "node": "8.x|10.x" }, But running yarn results in: The engine "node" is ...
rap-2-h's user avatar
  • 31.4k
111 votes
6 answers
148k views

Yarn not installing in nvm version node version

I'm running into an issue with yarn when I change my nvm version of node. I noticed when I check my ~/.nvm folder I see two node versions. v8.11.0 v8.11.3. I installed yarn globally. using npm ...
me-me's user avatar
  • 5,609
104 votes
10 answers
202k views

How do I change the version of yarn used?

I used Homebrew to install yarn. Running yarn -v shows that I currently use 0.23.2. I ran brew upgrade yarn to get the latest version, which is 0.24.6. After Homebrew successfully upgrades yarn, I run ...
davidhu's user avatar
  • 10.1k
103 votes
7 answers
243k views

What does " yarn build " command do? Are " npm build " and "yarn build" similar commands?

What does yarn build command do ? Are yarn build and npm build the same? If not what's the difference?
sudipt dabral's user avatar
102 votes
8 answers
115k views

How to install a list of many global packages with Yarn

yarn install -h suggests that the -g (global) option is DEPRECATED. How am I supposed to indicate that I want a bunch of packages (from package.json / yarn.lock files) to be installed globally? ...
jleeothon's user avatar
  • 3,056
101 votes
7 answers
123k views

Docker COPY files using glob pattern?

I have a monorepo managed by Yarn, I'd like to take advantage of the Docker cache layers to speed up my builds, to do so I'd like to first copy the package.json and yarn.lock files, run yarn install ...
Fez Vrasta's user avatar
  • 14.6k
99 votes
18 answers
46k views

Could not find plugin "proposal-numeric-separator"

How to fix Could not find plugin "proposal-numeric-separator", I get this error when I try to build my React application, I have not ejected the application yet: ./src/index.js Error: [BABEL] /home/...
user avatar
97 votes
3 answers
107k views

How can I update/downgrade package version with yarn?

I have a package and I want to downgrade the version use. How can I do this with yarn "dependencies"?
Emre's user avatar
  • 1,081
92 votes
7 answers
174k views

punycode is deprecated in npm - what should I replace it with?

I'm using the npm module punycode in my Angular project. VsCode tells me it's deprecated and https://nodejs.org/api/punycode.html#punycode_punycode confirms: The version of the punycode module ...
Ben Taliadoros's user avatar
87 votes
22 answers
104k views

An unexpected error occurred: "EPERM: operation not permitted in Yarn

I am having problems installing new npm packages with Yarn. Every time I go on to add a new package it's throwing me this error. But when I delete my node_modules folder and run Yarn, everything works ...
Pranta's user avatar
  • 3,476
87 votes
7 answers
82k views

How can I version bump all my dependencies?

Having yarn outdated is quite informative but I'd like to avoid running over package by package doing yarn upgrade. From yarn's documentation, just yarn upgrade without arguments is said to upgrade ...
tutuca's user avatar
  • 3,613
85 votes
5 answers
93k views

Jest test fails with "window is not defined"

I am trying to get started with state-of-the-art web development learning React and Redux. Right now I am stuck at getting tests running. For some reason, Jest fails with Task :frontend:test yarn jest ...
Gunnar Eketrapp's user avatar
84 votes
4 answers
58k views

Why wouldn't I use npm to install yarn?

In the blog post announcing yarn (an alternative npm client) they say, "The easiest way to get started is to run npm install -g yarn". But if you go to the "install yarn" page in their docs, "npm ...
Chris Arnesen's user avatar
83 votes
6 answers
85k views

Install Yarn Ubuntu 16.04 (Linux Mint 18.1)

I have a new installation of Linux Mint 18.1 with Ubuntu 16.04. I have installed Node 6.10.0. When doing the command that indicates the documentation of Yarn: sudo apt-get update && sudo apt-...
Jose's user avatar
  • 1,819
83 votes
6 answers
49k views

How can I update global packages in Yarn?

I tried some possible CLI commands but none seem to actually update the packages installed with yarn global add. yarn global upgrade & yarn upgrade global both don't work correctly. Is there a ...
thibmaek's user avatar
  • 1,191
82 votes
4 answers
142k views

What is the difference between yarn run and npm start?

Is yarn run intended to be the equivalent of npm start?
daniely's user avatar
  • 7,633

1
2 3 4 5
83