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'

enter image description here

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?

  1. currently loads module https://unpkg.com/@angular/core@2.0.0 intellij prefer loaded file on computer? should host files locally?

  2. 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

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -