Cannot find module 'underscore' || install underscore module in angular 2

You need to install that libraries typings definitions in previous versions, if you want to use an JS library in TypeScript.

In newer version of TypeScript uses @types system. So now you don't need to install typings manually, you can just write this. For first install

And then

Share This:


Setup angular2 local development environment

1) Install node js
2) sudo npm install npm -g // install NPM
3) sudo npm install -g typescript // install typescript
4) git clone https://github.com/angular/quickstart.git quickstart // cloning angular2 setup
5) cd quickstart
6) sudo npm install
7) sudo npm start

Via CLI

1) Install node js
2) sudo npm install npm -g // install NPM
3) sudo npm install -g typescript // install typescript
4) npm install -g @angular/cli
5) ng new my-app
6) sudo npm start

Share This: