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
2 answers

TypeError: Cannot create property 'lastUpdateCheck' on string 'lastUpdateCheck 1599160669280'

So I'm getting this error when I try to do a yarn install. I can yarn start without issue but i'm not sure if it's causing an issue behind the scenes so i'd like to resolve it. TypeError: Cannot create property 'lastUpdateCheck' on string…
user1218336
  • 21
  • 1
  • 3
2
votes
0 answers

Setting custom registry in Yarn doesn't seem to work

Bug description I have set yarn registry to a nexus registry using command : yarn config set registry https://custom/nexus/repository/npm-group-n3p/ I can then see the regsitry url in the local .yarnrc file However, when I then try and run : yarn…
Rubans
  • 4,188
  • 6
  • 40
  • 58
2
votes
2 answers

How do I downgrade from Yarn2 to Yarn1?

I'm using macOS and after installing Yarn2 several important tools no longer function. I've logged issues with them but in the meantime I need to get back to Yarn Classic. brew uninstall yarn and then tried brew install yarn@1.22.5 but this failed…
BillSaysThis
  • 712
  • 6
  • 17
2
votes
1 answer

How to install pre-release packages with Lerna and Yarn?

I have a monorepo setup with Lerna and Yarn. I would like to install and use some pre-release packages from a third party project into my monorepo and after some time I would like to switch to the "release" versions of those third party packages. Is…
gevik
  • 3,177
  • 4
  • 25
  • 28
2
votes
1 answer

Error: Cannot find module '@babel/plugin-syntax-dynamic-import' in symfony project

I followed the symfony documentation to enable webpack encore in my project: https://symfony.com/doc/5.1/frontend/encore/installation.html Commands i issued: > brew install node > npm install -g yarn > cd ~/path/to/project > yarn set version berry >…
larscm
  • 156
  • 3
  • 11
2
votes
1 answer

Why yarn install downloads node_modules for dependency?

I have a node projection which has a dependency let's say depA. After I run yarn install on my project, it downloads all dependencies for depA in node_modules/depA/node_modules which makes the node_modules directory very big. It doesn't download…
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
2
votes
3 answers

firebase command is not working after using yarn global on windows10

I am installing firebase-tools with yarn with the following command: yarn global add firebase-tools After it I am trying: firebase login And It giving me command not found an error. Please answer to solve this problem. I am using Windows 10…
Mohinder singh
  • 112
  • 1
  • 6
2
votes
1 answer

Lerna with Yarn, TypeScript and React Native: Cannot find module '@project/common' or its corresponding type declarations.ts(2307)

The project uses Yarn, React Native, Lerna and Typescript. It is structured as a monorepo Here is the structure: project |- packages | - mobile | - src | - packages.json | - tsconfig.json | - cloud-functions | -…
Xiiryo
  • 3,021
  • 5
  • 31
  • 48
2
votes
1 answer

How to authenticate azure devops pipeline , so that pipeline can restore yarn packages successfully

My application uses an yarn package which is installed in local after authentication.Registry url is specified in .npmrc file. Now my build pipeline fails, and says "Package restore failed" (Request failed "401 Unauthorized""). How to authenticate…
Deepak Kothari
  • 1,601
  • 24
  • 31
2
votes
0 answers

Yarn install with multiple git dependencies results in "EINVAL: invalid argument, mkdir ..." error

Node (v14.2.0), Yarn (1.22.4), Windows 10 Context: I have several node projects hosted in a private git repo. I have several cross dependencies between projects, e.g. project C depends on projects A and B, and project D may depend on C and A…
ryandb
  • 215
  • 4
  • 8
2
votes
1 answer

'Module not found' error when running webpack

A few days ago to solve a problem with the webpack module, I had to move my global dependencies to Development dependencies, before everything was working correctly, but now when I run the webpack it returns the following error: ERROR in…
luis matheus
  • 197
  • 1
  • 8
2
votes
2 answers

Error running install script for optional dependency ~/iltorb: Command failed

I need to setup a React project for which I want to install some Node dependencies. I ran yarn and got some errors; initially I thought the issue may relate to a conflict of version. So I changed the version and still I am getting the same…
Deepak
  • 143
  • 2
  • 10
2
votes
0 answers

Why are my yarn scripts slow when calling other yarn scripts?

I am debugging why certain yarn scripts on my work laptop (mac running through a VPN) are running slowly, and have found that if I call another yarn script from the first, it takes around 8 and a half seconds consistently each time. This happens…
2
votes
3 answers

terminal defaults to old yarn version (lerna bootstrap)

I don't think this is an issue specific to lerna, I actually think it is nvm related (though I commented out nvm from my .bash_profile to test that, without success). I'm trying to lerna bootstrap but it keeps using (and failing) an older version…
Dan Pouliot
  • 375
  • 2
  • 7
  • 21
2
votes
1 answer

"Hooks can only be called inside the body of a function component" error with react-native and yarn workspace

I am currently developing a project based on a yarn workspace. I had problems all day installing apollo correctly in react-native and finally, I managed to do so by changing the configuration of the metro.config.js file (which I leave below, even if…