为什么没有找到角度模块?

时间:2016-07-17 15:49:10

标签: asp.net angularjs angular

在visual studio下的angulsr2项目中,我将angular2从beta迁移到rc后无法编译打字稿文件。

我正在

  

构建:无法找到模块' @ angular2 / platform / browser'。

     

构建:无法找到模块' @ angular2 / router'。

     

构建:无法找到模块' @ angular2 / http'。

     

等...

项目树

Project Tree

错误

Errors

tsconfig.json

{
  "compilerOptions": {
    "sourceRoot": "/app/ts",
    "module": "system",
    "outDir": "./wwwroot/app/js",
    "target": "es6",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "compileOnSave": true,
  "exclude": [
    "node_modules",
    "typings"
  ]
}

** packages.json **

{
    "version": "1.0.0",
    "name": "AngularTest",
    "dependencies": {
      "@angular/common": "2.0.0-rc.1",
      "@angular/compiler": "2.0.0-rc.1",
      "@angular/core": "2.0.0-rc.1",
      "@angular/http": "2.0.0-rc.1",
      "@angular/platform-browser": "2.0.0-rc.1",
      "@angular/platform-browser-dynamic": "2.0.0-rc.1",
      "@angular/router": "2.0.0-rc.1",
      "@angular/router-deprecated": "2.0.0-rc.1",
      "@angular/upgrade": "2.0.0-rc.1",

      "systemjs": "0.19.27",
      "es6-shim": "^0.35.0",
      "reflect-metadata": "^0.1.3",
      "rxjs": "5.0.0-beta.6",
      "zone.js": "^0.6.12",
      "es6-promise": "^3.0.2",
      "bootstrap": "^3.3.5",
      "jquery": "2.1.4",
    },
    "devDependencies": {
      "gulp": "^3.9.1",
      "del": "2.1.0"
    }
}

我不确定错过了什么,我与其他项目进行比较,我似乎有相同但有些东西明显不同

1 个答案:

答案 0 :(得分:2)

没有@angular2。它可以是@angular,也可以是旧版angular2。您需要修复导入。

... from '@angular/platform/browser'.
... from '@angular/router'.
... from '@angular/http'.