1
votes

I am following Angular js tutorial from https://angular.io/guide/quickstart

and I am trying to use this code:

import {bootstrap, Component} from 'angular2/angular2';
@Component({
    selector: 'my-app',
    template: '<h1>My First Angular 2 App</h1>'
})
class AppComponent { }
bootstrap(AppComponent);

but I get this error:

cannot find module "angular2/angular"

Here is my folder structure:

Image

1
@PankajParkar is it related to this error ? - DotnetSparrow
as a workaround, you can put a path in front thus ../typings/angular2/angular2 - pinoyyid

1 Answers

1
votes

tsd for angular2 does not actually create the typings file in your typings directory instead it needs to be installed using node:

npm install -save angular2

Then in your tsdconfig.json, you need to enable node module resolution under compilerOptions:

"moduleResolution": "node"