2017-01-28 9 views
0

私はコード内のファイルの読み込みに次のエラーが直面しています:エラー:(SystemJS)XHRエラー(404が見つかりません)読み込みます。http:// localhostを:3000/traceur

(function (global) { 
    System.config({ 
     paths: { 
      // paths serve as alias 
      'npm:': 'node_modules/' 
     }, 
     // map tells the System loader where to look for things 
     map: { 
      // our app is within the app folder 
      app: 'src/app', 
      // angular bundles 
      '@angular/core': 'npm:@angular/core/bundles/core.umd.js', 
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js', 
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', 
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', 
      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', 
      '@angular/http': 'npm:@angular/http/bundles/http.umd.js', 
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js', 
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', 
      // other libraries 
      'rxjs': 'npm:rxjs', 
      'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js', 
      'jquery': 'npm:jquery/', 
      'lodash': 'npm:lodash/lodash.js', 
      'moment': 'npm:moment/', 
      'ng2-bootstrap': 'npm:ng2-bootstrap', 
      'ng2-slim-loading-bar': 'npm:ng2-slim-loading-bar', 
      'symbol-observable': 'npm:symbol-observable' 
     }, 
     // packages tells the System loader how to load when no filename and/or no extension 
     packages: { 
      app: { 
       main: './main', 
       defaultExtension: 'js' 
      }, 
      rxjs: { 
       defaultExtension: 'js' 
      }, 
      'angular-in-memory-web-api': { 
       main: './index.js', 
       defaultExtension: 'js' 
      }, 
      'moment': { main: 'moment.js', defaultExtension: 'js' }, 
      'ng2-bootstrap': { main: 'ng2-bootstrap.js', defaultExtension: 'js' }, 
      'ng2-slim-loading-bar': { main: 'index.js', defaultExtension: 'js' }, 
      'symbol-observable': { main: 'index.js', defaultExtension: 'js' } 
     } 
    }); 
})(this); 

とapp.componentを持っていますこのような.TS:

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 
import { AppModule } from './app.module'; 

platformBrowserDynamic().bootstrapModule(AppModule); 

とpakages.json私はこのような持っている:

import { Component, OnInit, ViewContainerRef } from '@angular/core'; 
// Add the RxJS Observable operators we need in this app. 
import './rxjs-operators'; 

@Component({ 
    moduleId: module.id, 
    selector: 'scheduler', 
    templateUrl: 'app.component.html' 
}) 
export class AppComponent { 

    constructor(private viewContainerRef: ViewContainerRef) { 
     // You need this small hack in order to catch application root view container ref 
     this.viewContainerRef = viewContainerRef; 
    } 
} 

とmain.tsを持っているが、このようなファイル

{ 
    "version": "1.0.0", 
    "name": "scheduler", 
    "author": "Chris Sakellarios", 
    "license": "MIT", 
    "repository": "https://github.com/chsakell/angular2-features", 
    "private": true, 
    "dependencies": { 
    "@angular/common": "~2.1.0", 
    "@angular/compiler": "~2.1.0", 
    "@angular/core": "~2.1.0", 
    "@angular/forms": "~2.1.0", 
    "@angular/http": "~2.1.0", 
    "@angular/platform-browser": "~2.1.0", 
    "@angular/platform-browser-dynamic": "~2.1.0", 
    "@angular/router": "~3.1.0", 
    "@angular/upgrade": "~2.1.0", 
    "angular-in-memory-web-api": "~0.1.5", 
    "bootstrap": "^3.3.6", 
    "core-js": "^2.4.1", 
    "jquery": "^3.0.0", 
    "lodash": "^4.13.1", 
    "moment": "^2.13.0", 
    "ng2-bootstrap": "^1.3.0", 
    "ng2-slim-loading-bar": "1.5.1", 
    "reflect-metadata": "^0.1.8", 
    "rxjs": "5.0.0-beta.12", 
    "systemjs": "0.19.39", 
    "zone.js": "^0.6.25" 
    }, 
    "devDependencies": { 
    "concurrently": "^3.0.0", 
    "gulp": "3.9.1", 
    "gulp-replace": "0.5.4", 
    "del": "2.2.2", 
    "gulp-sourcemaps": "2.2.0", 
    "jquery": "^3.0.0", 
    "lite-server": "^2.2.0", 
    "typescript": "2.0.2", 
    "typings": "^1.3.2", 
    "tslint": "^3.10.2" 
    }, 
    "scripts": { 
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite --baseDir ./app --port 8000\" ", 
    "lite": "lite-server", 
    "postinstall": "typings install", 
    "tsc": "tsc", 
    "tsc:w": "tsc -w", 
    "typings": "typings" 
    } 
} 

エラー画像enter image description here は私がstakeoverフローに記載されているすべてのソリューションを試みたが、私はこの問題を解決することはできませんよ、バウアーコンポーネントとnode_modulesは、すでに設定し、応答を.Lookingすべてのファイルを持っています。

ありがとうございます。

+0

を行を変更することで、これを修正しました。 jsファイル? –

+0

これはsystem.config.js –

+0

です。あなたは/*systemconfig.jsのような記述はしていませんが、あなたは決してコメントを閉じることはできません...この行を削除してみるかコメントを閉じる –

答えて

2

私はこの問題に時間を費やし、あなたがsystem.configの初めに*/systemcoonfig.jsを持っていないのはなぜ最終的に私は、メインセクションにsystem.config.jsに

map: { 
      // our app is within the app folder 
      app: 'src/app', 
      // angular bundles 
      '@angular/core': 'npm:@angular/core/bundles/core.umd.js', 
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js', 
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', 
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', 

      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', 
      '@angular/http': 'npm:@angular/http/bundles/http.umd.js', 
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js', 
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', 
      // other libraries 
      'rxjs': 'npm:rxjs',    
      'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js', 
      'jquery': 'npm:jquery/', 
      'lodash': 'npm:lodash/lodash.js', 
      'moment': 'npm:moment/', 

      // the line that changed: 
      'ng2-bootstrap': 'npm:ng2-bootstrap/bundles/ng2-bootstrap.umd.js', 
      'ng2-slim-loading-bar': 'npm:ng2-slim-loading-bar', 
      'symbol-observable': 'npm:symbol-observable' 
     }, 
+0

どの行ですか? –

+0

'ng2-bootstrap': 'npm:ng2-bootstrap/bundles/ng2-bootstrap.umd.js'、//この行が変更されました。 –

関連する問題