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

Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider

I'm getting this strange error when I'm importing Overlay from 'react-native-elements'. So I've tried some solutions like deleting yarn lock file, removing react-native-safe-area-context from package.lock file and then deleting node_modules and…
2
votes
2 answers

Expo CLI installed through yarn, but not working

So I tried installing expo CLI for my react native project. I tried installing it with npm as shown on the official expo.io website, but it didn't work out. So as per the answers from this stack overflow post. It installed with the command yarn…
Abhisek Ganguly
  • 125
  • 2
  • 11
2
votes
1 answer

Problem with creation a new react-typescript app with 'npx create-react-app my-app --template typescript'

When I try to create a new typescript react app, an error occurs. I run npx create-react-app my-app --template typescript and it cause this error Error: Cannot find module './copy-sync' I tried with yarn again, yarn create-react-app my-app…
S. Hesam
  • 5,266
  • 3
  • 37
  • 59
2
votes
1 answer

How to remove CRA from yarn workspaces?

I'm using yarn workspaces (Monorepo) and I added an already made create react app, but now, every time I need to build only one project from the Monorepo, it installs everything from create react app even though it won't be used. What I need to do…
Vencovsky
  • 28,550
  • 17
  • 109
  • 176
2
votes
0 answers

How to kill yarn process

I have a JavaScript React project, managed with yarn. I'd like to run it in the background, and be able to kill it from a script file. This needs to work on both Mac and Linux, and should not require su. I've got this all working (so far, only…
David Goldfarb
  • 1,796
  • 3
  • 18
  • 32
2
votes
1 answer

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. React-Native

So I have been doing a lot of research as to why this isn't working and wasn't able to find anything. Does anyone know what this error pertains to? Error: Element type is invalid: expected a string (for built-in components) or a class/function (for…
Peter
  • 65
  • 2
  • 13
2
votes
1 answer

Yarn installs, but all commands return MODULE_NOT_FOUND code

The link below doesn't answer my question Issue reinstalling yarn - code: 'MODULE_NOT_FOUND' I get an error trying to run yarn on it's own or with a command ➜ ~ brew install yarn Error: homebrew-core is a shallow clone. To `brew update` first…
Rohitus
  • 159
  • 2
  • 7
2
votes
1 answer

Why are unmet peer dependencies not resolved when using yarn link?

I have 2 node packages : foo-service and foo-commons. foo-commons is a dependency of foo-service. While development,every time there is a change in foo-commons, to use them in foo-service I copy the compiled source from foo-commons to …
97amarnathk
  • 957
  • 2
  • 11
  • 30
2
votes
1 answer

yarn global install isn't available in path

I'm trying to install yarn on Ubuntu 18.04 using nvm and npm. The installation succeeds and shows that it's installed globally. The which command points to the right directory as well, but the command can't be used by itself, or as yarn install…
Allan Bogh
  • 605
  • 8
  • 15
2
votes
1 answer

Can you use Yarn2 PnP "zero-installs" on a machine without Yarn?

I'm playing with Yarn 2's "zero install" stuff for a minor tool to address one of my boss's random allergies. (He takes umbrage at the expectation of having to run npm i on a cloned repo to make it work and insists putting node_modules into version…
millimoose
  • 39,073
  • 9
  • 82
  • 134
2
votes
1 answer

Package which is a dependency of my library isn't installed (@angular/material/core not found)

I got a angular custom library @foo/bar, which has these dependencies: "peerDependencies": { "@angular/common": "^10.0.14", "@angular/core": "^10.0.14" }, "dependencies": { "@angular/material": "11.0.1", "@ngx-translate/core":…
coder14
  • 223
  • 1
  • 4
  • 14
2
votes
0 answers

npm error when run npm install but no error when run yarn install

This is a general question I searched a solution for but I couldn't find resonable one. First: I am building Laravel apps on homestead branch 20.04 development environment, everything works fine except when running npm install on any laravel new…
Ya Basha
  • 1,902
  • 6
  • 30
  • 54
2
votes
1 answer

Error: Unable to resolve module `./node_modules\expo\AppEntry` from ``

I can't figure out what is happening here, I'm getting the following error when trying to open my project in the Expo Client App: Error: Unable to resolve module `./node_modules\expo\AppEntry` from ``: None of these files exist: *…
alain00
  • 161
  • 2
  • 11
2
votes
1 answer

yarn create react-app with typescript throwing errors

I am trying to create a new react app: yarn create react-app my-app --template typescript Installation seems to work fine, but when I try to yarn start the app, I get an…
FelHa
  • 1,043
  • 11
  • 24
2
votes
3 answers

No files matching the pattern .s?(c|a)ss" were found on Sage

When I try to run Sage 9.0.10 in my Wordpress 5.5.3 theme and install Yarn and then do "yarn build" or "yarn start" I get this error: PS C:\xampp\htdocs\patrick.visiegroep\wp-content\themes\visiegroep> yarn build yarn run v1.22.5 $ webpack…
Pat
  • 21
  • 1
  • 5