javascript - Angular2 intelliJ config error.. Cannot find module '@angular/core' -
i new angular2. following tutorial angular2 example
. first simple tutorial called guess-the-number
i used code described in github provided example https://github.com/chandermani/angular2byexample/tree/master/guessthenumber.
it loads fine in browser. intellij setup i'm having issues.
intellij returning following error.. seen in screenshot. cannot find module '@angular/core'
my properties file follows
systemjs.config.js
system.config({ map : { 'app': 'app', 'rxjs': 'https://unpkg.com/rxjs@5.0.0-beta.12', '@angular/common': 'https://unpkg.com/@angular/common@2.0.0', '@angular/compiler': 'https://unpkg.com/@angular/compiler@2.0.0', '@angular/core': 'https://unpkg.com/@angular/core@2.0.0', '@angular/platform-browser': 'https://unpkg.com/@angular/platform-browser@2.0.0', '@angular/platform-browser-dynamic': 'https://unpkg.com/@angular/platform-browser-dynamic@2.0.0' }, packages:{ 'app': { main: 'main.ts', defaultextension: 'ts' }, '@angular/common': { main: 'bundles/common.umd.js', defaultextension: 'js' }, '@angular/compiler': { main: 'bundles/compiler.umd.js', defaultextension: 'js' }, '@angular/core': { main: 'bundles/core.umd.js', defaultextension: 'js' }, '@angular/platform-browser': { main: 'bundles/platform-browser.umd.js', defaultextension: 'js' }, '@angular/platform-browser-dynamic': { main: 'bundles/platform-browser-dynamic.umd.js', defaultextension: 'js' }, }, // demo only! real code should not transpile in browser transpiler: 'typescript', typescriptoptions: { emitdecoratormetadata: true } });
my thoughts on potential solution?
currently loads module https://unpkg.com/@angular/core@2.0.0 intellij prefer loaded file on computer? should host files locally?
intellij not know systemjs.config.js file? need create tsconfig.json file? intellij can understand?
the errors come ts compiler. , yes, idea itself, can't find @angular
modules cdn references in system config: needs modules being available locally in project (installed via npm - see https://angular.io/docs/ts/latest/guide/setup.html, example). configuration yours work when using browser based compilation
Comments
Post a Comment