cannot find module '@angular/core'?

1,489 views
Skip to first unread message

random512

unread,
Jul 22, 2016, 12:11:32 PM7/22/16
to AngularJS
I'm trying to run an Angular 2 app but the build is failing with the error "Cannot find module '@angular/core'".  I've tried the following steps:

* In VS2015 I've set my TypeScript Build > Module System to CommonJS
* In VS2015 Tools > Options > Text Editor > TypeScript > Project has the following options checked:
=> Automatically compile TypeScript files which are not part of a project
=> Use CommonJS code generation for modules that are not part of a project
=> ECMAScript version for files that are not part of a project = ECMAScript
* In tsconfig.json I've set "target" to "es6"
* "npm list" on my website node_modules directory shows that angular1 and angular2 are installed

What do you recommend as next steps to debug?


Lucas Lacroix

unread,
Jul 22, 2016, 12:29:00 PM7/22/16
to ang...@googlegroups.com
I think "angular2" is the old beta/alpha. All the angular2 modules are in the @angular scope and need to be installed individually. I think this happened when rc0 was released.

npm i @angular/core --save
npm i @angular/http --save

There is no longer one large angular2 package.

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Lucas Lacroix
Computer Scientist
System Technology Division, MEDITECH
Reply all
Reply to author
Forward
0 new messages