Here's how to install Angular using Node Package Manager.
Step 1 - Angular
Install the latest version of Angular.
npm install -g @angular/cli@latest
Step 2 - Typescript Definitions
npm install -g @types/npm
Step 3 - Typescript
Install the latest version of Typescript.
npm install -g typescript
Step 4 - Yarn
Install the latest version of Yarn. Yarn is a better package manager than
npm. Yes, it's ironic that you use
npm to install
yarn but in the end, if you want to achieve something similar to Ruby on Rail's "freeze" or
bundle package, yarn is your best bet.
npm install -g yarn
Step 5 - Use yarn instead of NPM
Moving forward, you should try using
yarn instead of
npm i . It will help you experience less dependency hell.
Step 6 - Create an app
Create a new app and change directory.
ng new myapp && cd myapp
Step 7 - Learn more
There's a lot more to learn about Angular 2. Here's another tutorial on the different types of commands you can run using Angular command line interface.
If you have any issues installing Angular, try these troubleshooting solutions.
- Angular CLI globally.