Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't Yarn install all executables in .bin folder?

I've just started using the Yarn package manager and I downloaded a starter Ionic 2 project.

In this project, we have a lot of help from scripts that compile, minify, lint and bundle our code. All of this is provided by ionic-app-scripts, which has several dependencies which it uses to run commands.

The problem is when I use Yarn to install, the node_modules/.bin/ folder does not contain all the necessary executables, like tslint, which is a dependency of ionic-app-scripts, so it is not directly in my package.json.

The result is that when I use Yarn, ionic-app-scripts doesn't work because it expects that the .bin folder contains a tslint executable!

What can I do? Are the ionic-app-scripts's definitions a problem?

[note]: npm install works, but Yarn is much faster!

like image 241
Abraão Alves Avatar asked Oct 12 '16 16:10

Abraão Alves


People also ask

Where does yarn install files?

yarn will ensure all global packages will have their executables installed to ~/. yarn/bin . yarn global dir will print the output of the global installation folder that houses the global node_modules .

How do I install all yarn dependencies?

To install dependencies, you have to run yarn install in the root of your directory to install all the dependencies for a project. The dependencies will be retrieved from the package. json file you pushed to version control, and will be stored in the yarn. lock file.

How do I fix a yarn install error?

To solve the error "yarn: command not found", install the yarn package globally by running npm install -g yarn and restart your terminal. If the command fails, run it with sudo and make sure the correct PATH is set in your system's environment variable.

Does yarn need to be installed globally?

The Yarn maintainers recommend installing Yarn globally by using the NPM package manager, which is included by default with all Node. js installations. Use the -g flag with npm install to do this: sudo npm install -g yarn.


1 Answers

This is a known issue, and there's a pull request with more information.

In short, if you want to fix this now, you'll have to explicitly include the packages from which you need binaries in your dependencies.

like image 51
Martin Solli Avatar answered Sep 28 '22 08:09

Martin Solli