2016-09-19 11 views
0

설정 ASP.NET MVC 5 (코어가 아님) + 각도 2.0.0 + JSPM + SystemJS + TS Loader을 시도합니다.404를 찾을 수 없음/platform-browser.js

Failed to load resource: the server responded with a status of 404 (Not Found) 
http://localhost:59711/@angular/platform-browser.js 

Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:59711/@angular/platform-browser.js(…) 

@angular 패키지 폴더 jspm_packeges/NPM에 : 나는 응용 프로그램을 실행하면

나는 오류가 발생합니다.

이제는 어떤 문제의 근원이 Angular인지 또는 SystemJS의 변경 사항인지 전혀 알지 못합니다.

tsconfig.json

{ 
    "compilerOptions": { 
    "target": "es5", 
    /* target of the compilation (es5) */ 
    "module": "system", 
    /* System.register([dependencies], function) (in JS)*/ 
    "moduleResolution": "node", 
    /* how module gets resolved (needed for Angular 2)*/ 
    "emitDecoratorMetadata": true, 
    /* needed for decorators */ 
    "experimentalDecorators": true, 
    /* needed for decorators (@Injectable) */ 
    "noImplicitAny": false 
    /* any has to be written explicity*/ 
    }, 
    "exclude": [ 
    /* since compiling these packages could take ages, we want to ignore them*/ 
    "jspm_packages", 
    "node_modules" 
    ], 
    "compileOnSave": false 
    /* on default the compiler will create js files */ 
} 

config.js (니혼 전자 : JSPM는, 구성 파일을 단순화)

System.config({ 
    baseURL: "/", 
    defaultJSExtensions: true, 
    transpiler: "babel", 
    babelOptions: { 
    "optional": [ 
     "runtime", 
     "optimisation.modules.system" 
    ] 
    }, 
    typescriptOptions: { 
    "tsconfig": true 
    }, 
    paths: { 
    "github:*": "jspm_packages/github/*", 
    "npm:*": "jspm_packages/npm/*" 
    }, 

    packages: { 
    "app": { 
     "main": "bootstrap", 
     "format": "system", 
     "defaultExtensions": "ts", 
     "meta": { 
     "*.ts": { 
      "loader": "ts" 
     } 
     } 
    } 
    }, 

    map: { 
    "@angular/common": "npm:@angular/[email protected]", 
    "@angular/compiler": "npm:@angular/[email protected]", 
    "@angular/core": "npm:@angular/[email protected]", 
    "@angular/http": "npm:@angular/[email protected]", 
    "@angular/platform-browser-dynamic": "npm:@angular/[email protected]", 
    "@angular/router": "npm:@angular/[email protected]", 
    "babel": "npm:babel-c[email protected]", 
    "babel-runtime": "npm:[email protected]", 
    "core-js": "npm:[email protected]", 
    "reflect-metadata": "npm:[email protected]", 
    "rxjs": "npm:[email protected]", 
    "ts": "github:frankwallis/[email protected]", 
    "zone.js": "npm:[email protected]", 
    "github:frankwallis/[email protected]": { 
     "typescript": "npm:[email protected]" 

     //... 
    } 
}); 

index.html을 : 여기

내 구성 파일입니다

<script> 
    System.config 
    ({ 
     transpiler: "ts", 
     packages: 
     { 
      "app": { 
       "defaultExtension": "ts", 
      } 
     } 
    }); 

System.import('app/bootstrap').catch(console.log.bind(console)); 
</script> 

Visual Studio는 모든 각 가져 오기에 대해 불평합니다. '@ 각도/플랫폼 브라우저': 'NPM은 : 각도/플랫폼 브라우저 @ 2.0.0 패키지 @없는

bootstrap.js

import {bootstrap} from "@angular/platform-browser" 
import {provide} from "@angular/core" 

답변

1

는 것 같다.

map: { 
    "@angular/common": "npm:@angular/[email protected]", 
    "@angular/compiler": "npm:@angular/[email protected]", 
    ... 
    ... 
    '@angular/platform-browser': "npm:@angular/[email protected]" 
    ... 
    ... 
} 

참고 : 이미 거기 경우에도 내가 _Layout.cshtml에 System.config에 맵을 추가하려고

"dependencies": { 
    "@angular/common": "2.0.0", 
    "@angular/compiler": "2.0.0", 
    ... 
    ... 
    "@angular/platform-browser": "2.0.0", 
    ... 
} 
+0

, package.json에 추가하지만 나에게 컴파일러 오류 메시지를 제공합니다 : CS0103 : 'angular'라는 이름이 현재 컨텍스트에 존재하지 않습니다. – rco

+0

저에게 완전히 알려지지 않은 오류입니다! – micronyks

+0

Package.json 구성이 정상입니다. jspm 또는 systemjs 구성 파일에 맵 섹션을 추가 하시겠습니까? 왜냐하면 jspm에 이미 있었기 때문입니다. – rco