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

Why react-snap push fails to Heroku?

I went through setup of react-snap, but when pushing to Heroku it fails. https://www.npmjs.com/package/react-snap Do you have any idea why? remote: Error: Failed to launch chrome! remote:…
János
  • 32,867
  • 38
  • 193
  • 353
2
votes
0 answers

yarn install fails (building protagonist with node-gyp)

yarn install suddenly fails on my project. I have tried downgrading my Node to 12.14. Even my Linux Kernel, using node alpine in docker, ensuring I have gcc but nothing works: yarn install v1.22.4 [1/5] Validating package.json... [2/5] Resolving…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
2
votes
1 answer

How to install npm package in Lerna + Yarn Workspaces repo?

If I want to add dependency to a package, do I need to cd into that directory and run yarn add ? Or, is there a command I can run in root directory possibly with a flag like --workspace=?
user311413
  • 137
  • 1
  • 8
2
votes
2 answers

Missing src folder with YARN or NPM package install

Creating a simple package.json yarn init { "name": "freedraw", "version": "1.0.0", "main": "index.js", "license": "MIT" } Adding leaflet-freedraw dependency: yarn add leaflet-freedraw { "name": "freedraw", "version": "1.0.0", …
Mike
  • 5,416
  • 4
  • 40
  • 73
2
votes
1 answer

upgrade specific package yarn lock after Dependabot alert on github

I have this error on github : I didn't find any solution. Did I have to update manually in yarn.lock package the version of Logkitty and after that, commit and push? Or a commande exist to upgrade specific package? Why this error appear in…
samuel
  • 477
  • 7
  • 21
2
votes
0 answers

unable to "yarn" upgrade to @react-native-firebase/firestore@7.3.0

The new release launched yesterday, but until today I still couldn't upgrade to the latest release. My yarn repository configure:https://registry.yarnpkg.com. Does anyone know how to solve this issue?
Nelson Au
  • 21
  • 1
2
votes
1 answer

cant create nestjs project

I am trying to make new nestjs project on my windows10 using the nest new project-name command. However, after while it tells me this error: ? Which package manager would you �� to use? yarn ����� Installation in progress... � Failed to execute…
kadhum alrubaye
  • 151
  • 1
  • 7
2
votes
1 answer

Why can't yarn.lock found in my Docker container?

I am run a single Node.js script like so: docker run -it --rm -u node --name build_container -v $(pwd):/home/node/app -w "/home/node/app" node:lts bash -c "yarn install --no-cache --frozen-lockfile". However, the script log shows the displays info…
Fernando Souza
  • 795
  • 8
  • 11
2
votes
0 answers

gitlab ci - refs and changes together does not work

I am trying to create a nodeJS project pipeline and introduce caching layer so that the node_modules are not built always . I am using GITLAB pipelines and have the below stage for installing dependencies :- Install Dependencies: stage:…
Shinto K A
  • 21
  • 1
2
votes
2 answers

How to list and use packages in Yarn 2?

Since I'm a beginner with Yarn, therefore I have followed the current Yarn tutorial, and it describes Yarn 2. So I have installed Yarn 2. yarn --version command gives 2.0.0-rc.34. But Yarn 2 seems to lack a command to show the list of the packages…
Kydesnic
  • 21
  • 1
  • 4
2
votes
2 answers

Cannot find module 'react-native-elements'

Just created my first React-Native application and added my first library 'react-native-elements' using yarn add react-native-elements the package appears in my node_modules folder and yarn.lock, however I receive the following error: Cannot find…
wuiiz93
  • 119
  • 1
  • 10
2
votes
0 answers

Error: command "start" not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command

I am learning React and while implementing my first react app, it shows me this error: error Command "start" not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. when I run: yarn start I have installed…
code_ghost
  • 49
  • 1
  • 4
2
votes
1 answer

npm run build and if success then commit

how I need to set up package.json to check if build success then add and commit changes to git? Current build: "build": "react-scripts build"
denismart
  • 492
  • 6
  • 15
2
votes
0 answers

run yarn command with pm2

I need to deploy my app on digital ocean, after installing all dependencies i ran my script yarn dev "scripts": { "dev": "nodemon --delay 10ms --exec babel-node -- app.js", "start": "NODE_ENV=stag nodemon --delay 10 --exec babel-node --…
Shubham Shaw
  • 841
  • 1
  • 11
  • 24
2
votes
2 answers

"lerna changed" lists all packages

I've cloned a monorepo I was working on onto a new dev machine, all packages from the repo have been published already. But when I run lerna changed - it says "assuming all packages changed" and lists all the packages from the repo. And if I run…
Yuriy Galanter
  • 38,833
  • 15
  • 69
  • 136