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
1 answer

how can i use 'node_modules' directly with 'yarn berry'

i used node_modules to run a script and, copied node_modules to 'dist' to import modules 'packages.json' "scrips":{ "start" : "node ./node_modules/storybook/server/index.js" } and 'vite.config.ts' import copy from "rollup-plugin-copy"; …
제리님
  • 21
  • 2
2
votes
1 answer

supervisord not killing all spawned node processes on stop command

I encountered something weird when deploying a new service with supervisord. These are the relevant parts: # supervisord.conf [program:express] command=yarn re-express-start # package.json { "scripts": { "re-express-start": "node…
Martin Melka
  • 7,177
  • 16
  • 79
  • 138
2
votes
0 answers

Yarn install problem when project folder name has spaces (link is not recognized as an internal or external command, operable program or batch file)

When I run yarn install in VS Code I get errors because my project is in folder whose name contains spaces. If I write a command in console manually I can make use of quotes to avoid such problem (like cd "folder path with spaces") How can I run…
vytaute
  • 1,260
  • 4
  • 16
  • 36
2
votes
1 answer

Deployment failed, bin/yarn: Permission denied

The deployment fails in production, it seems that yarn don't have rights to read the file. How can i manage rights to yarn when deployment ? Thanks Rails 6.1.3.1 // Node v15.5.1 // Tailwindcss: 2.1.1 production logs Using sassc-rails 2.1.2 …
AnnABlue
  • 121
  • 3
  • 12
2
votes
2 answers

yarn link list all registered packages

Yarn's link allows you to register a local package for symlinking into another local package. however - I suspect one of the links is linking to the wrong package. how can I list all the registered linked packages by yarn? the docs does not help I'm…
Eliav Louski
  • 3,593
  • 2
  • 28
  • 52
2
votes
1 answer

yarn 2 upgrade appears to have broke typescript types, where yarn 1 install of same project succeeds?

I have been trying to upgrade a typescript monorepo to make use of yarn 2 but am running into an issue where typescript is no longer able to determine certain react props. Since this was working in yarn 1.x, I am thinking there must have been some…
jdk905
  • 495
  • 5
  • 11
2
votes
0 answers

Install node-sass dependency using yarn install

Trying to get a project built on Ruby to run locally but I'm running into an issue (or a few) node-sass: command failed when running yarn install. After that it goes downhill. I have installed Node, Ruby, Rails, etc but I can't find a solution for…
fernie
  • 57
  • 7
2
votes
1 answer

How to include Node.js native modules while compiling to .exe

I'm using pkg to compile my Node.js project into an executable. The project includes a native module called "node-printer". Pkg has problems compiling this module, because when i run the executable i get this error: pkg/prelude/bootstrap.js:1359 …
Semion Vino
  • 121
  • 1
  • 9
2
votes
1 answer

How do I pass arguments to react-scripts start command and use them in react?

I have a .sh file with the follow code: react-scripts start HOST=0.0.0.0 And my yarn start scripts is: "scripts": { "start": "./run.sh", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, The problem is…
kevin parra
  • 336
  • 4
  • 11
2
votes
1 answer

Yarn private gitlab registry .tgz not found

I publish a npm package to my private npm registry provided by gitlab. No I try to install the package in another project. The authentication is done via .npmrc which is located in the project…
Markus
  • 1,909
  • 4
  • 26
  • 54
2
votes
1 answer

How to resolve yarn warnings

I created a new project with the vue cli. This project is a Vue3 with Ant Design, Vue Router and Eslint. However when I give the yarn command it shows me the following warnings. yarn install v1.22.10 [1/4] Resolving packages... [2/4] Fetching…
Abner Matheus
  • 41
  • 1
  • 8
2
votes
1 answer

how to fix yarn.lock and package-lock json mix

So i was going on with my nodejs project and was trying to install a package with npm, but it got stuck in the process. I found I could use yarn which i, the very next second, did. It worked, but now im trying to host it on Heroku and I have both,…
MasterMind
  • 884
  • 8
  • 21
2
votes
2 answers

Node Sass Error: Cannot find module 'mkdirp'

I have the following package.json "devDependencies": { "bootstrap-sass": "*", "buble": "^0.12.5", "css-loader": "^0.25.0", "gulp": "*", "jquery": "^3.1.0", "json-loader": "^0.5.4", "laravel-elixir": "^6.0.0-14", …
Kendall
  • 5,065
  • 10
  • 45
  • 70
2
votes
0 answers

yarn / npm install node-gyp problem "node-pre-gyp install --fallback-to-build --library=static_library"

I made a clone of my own repository in a diferent laptop and when i've tried to execute "yarn install" or "npm install" it stops and return some errors. I've researched a lot, tried to delete yarn.lock, package-lock, install node-pre-gyp globally,…
2
votes
0 answers

Jest --findRelatedTests flag not finding related test

Running the CLI command yarn run jest --findRelatedTests src/components/Banner.js in my environment doesn't run the corresponding test Banner.test.js located in the __tests__ folder in the same directory. Why would this happen? Output of the…
Jed Tan
  • 39
  • 7