升级到angular-2.0.0-rc.4之后找不到模块错误

时间:2016-07-01 16:23:05

标签: angular

我在Package.json中使用以下内容更新了我的angular2引用,但在更新之后,现在我在浏览器控制台中收到以下404错误:

    Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/facade/async Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/facade/collection Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/facade/exceptions Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/core Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/platform/dom/dom_adapter Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/facade/promise Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/core/util/decorators Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/facade/collection Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/core/di/decorators Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/core/reflection/reflection Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/facade/exceptions Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/core Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/facade/lang Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/core/di/decorators Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/core/reflection/reflection Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/facade/async Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/facade/promise Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/platform/dom/dom_adapter Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:55413/angular2/src/core/util/decorators Failed to load resource: the server responded with a status of 404 (Not Found)

虽然现在正在编译,但我仍然在Visual Studio IDE中收到以下错误。

Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\bindCallback.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\bindNodeCallback.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\combineLatest.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\concat.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\defer.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\empty.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\forkJoin.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\from.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\fromEvent.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\fromEventPattern.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\fromPromise.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\interval.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\merge.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\never.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\of.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\race.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\range.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\timer.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\observable\zip.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\audit.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\auditTime.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\buffer.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\bufferCount.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\bufferTime.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\bufferToggle.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\bufferWhen.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\cache.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\catch.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\combineAll.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\combineLatest.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\concat.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\concatAll.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\concatMap.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\concatMapTo.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\count.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\debounce.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\debounceTime.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\defaultIfEmpty.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\delay.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\delayWhen.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\dematerialize.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\distinctUntilChanged.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\do.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\every.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\expand.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\filter.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\finally.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\first.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\groupBy.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\ignoreElements.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\last.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\let.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\map.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\mapTo.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\materialize.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\merge.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\mergeAll.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\mergeMap.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\mergeMapTo.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\multicast.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\observeOn.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\partition.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\pluck.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\publish.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\publishBehavior.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\publishLast.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\publishReplay.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\race.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\reduce.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\repeat.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\retry.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\retryWhen.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\sample.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\sampleTime.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\scan.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\share.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\single.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\skip.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\skipUntil.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\skipWhile.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\startWith.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\subscribeOn.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\switch.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\switchMap.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\switchMapTo.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\take.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\takeLast.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\takeUntil.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\takeWhile.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\throttle.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\throttleTime.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\timeout.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\timeoutWith.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\toArray.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\toPromise.d.ts    2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\window.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\windowCount.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\windowTime.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\windowToggle.d.ts 2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\windowWhen.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\withLatestFrom.d.ts   2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\zip.d.ts  2   Active
Error   TS2664  Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\zipAll.d.ts   2   Active

我的PACKAGE.json文件如下:

  {
  "name": "ASP.NET",
  "version": "0.0.0",
  "dependencies": {
    "@angular/core": "2.0.0-rc.4",
    "@angular/http": "2.0.0-rc.4",
    "@angular/platform-browser": "^2.0.0-rc.4",
    "bootstrap": "3.3.6",
    "es6-promise": "3.2.1",
    "es6-shim": "0.35.1",
    "jquery": "3.0.0",
    "reflect-metadata": "0.1.3",
    "rxjs": "5.0.0-beta.6",
    "systemjs": "0.19.31",
    "zone.js": "0.6.12"
  },
  "devDependencies": {
    "gulp": "3.9.1",
    "gulp-concat": "2.6.0",
    "gulp-cssmin": "0.1.7",
    "gulp-uglify": "1.5.4",
    "rimraf": "2.5.2"
  }
}

我的tsconfig.json文件如下

{
  "compilerOptions": {
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "commonjs",
    "noEmitOnError": true,
    "noImplicitAny": false,
    "outDir": "../wwwroot/appScripts/",
    "removeComments": false,
    "sourceMap": true,
    "target": "es5"
  },
  "exclude": [
    "node_modules",
    "typings/browser/",
    "typings/browser.d.ts"
  ]
}

我错过了什么?我还需要添加任何其他参考资料吗?

2 个答案:

答案 0 :(得分:1)

你真的需要

"@angular/common": "^2.0.0-rc.4",
"@angular/compiler": "^2.0.0-rc.4",
"@angular/platform-browser": "^2.0.0-rc.4"
当您包含“@ angular / http”

时,在您的devDependencies中

和rxjs应该使用

"rxjs": "5.0.0-beta.6"

答案 1 :(得分:0)

使用https://raw.githubusercontent.com/Microsoft/TypeScript/Fix8518/lib/typescriptServices.js中的文件替换C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ Common7 \ IDE \ CommonExtensions \ Microsoft \ TypeScript \ typescriptServices.js。首先进行本地备份。

感谢此作者检查link