Step 2 Working with Yarn
NPM is one of the most popular package managers, but it has some shortcomings:
- Nested dependencies cause a long file path on Windows.
- NPM does only sequential installation, so one package must be completely installed before you can start installing the next one.
- It can only install from the NPMSJS package and it does not have offline installation.
Yarn solves these problems. Yarn is a fast, reliable, and secure package manager that takes packages from npmjs or bower registry.
You can learn more about Yarn on its github page.
Like NPM, Yarn also reads package.json files of your project to install dependencies.
To work with Yarn, download the start project and open it in the terminal.
If you do not have Yarn installed on your machine, you must install it with the command below:
npm install –g yarn
Note: If you are using Apple’s Mac OS, you may receive permission errors when you try to install global packages with NPM. If this happens, try:
sudo npm install –g yarn
After installing Yarn, you can use it to install dependencies in your project. To install dependencies, run the command below:
yarn add igniteui-angular2
After successful installation, you will find a node_modules folder added in the project. To run the application, execute the command below:
If everything is correct, the above command should start the application and you will have a running application as shown below: