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!
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 .
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With