請大家幫忙看看,憋了一上午了,在線等,先謝謝了!
錯誤訊息:
ERROR in /Users/honpery/personal_project/honpery_com/admin_rewrite/node_modules/@angular/core/src/facade/async.d.ts
(8,28): error TS2307: Cannot find module 'rxjs/Observable'.
ERROR in /Users/honpery/personal_project/honpery_com/admin_rewrite/node_modules/@angular/core/src/facade/async.d.ts
(9,25): error TS2307: Cannot find module 'rxjs/Subject'.
ERROR in /Users/honpery/personal_project/honpery_com/admin_rewrite/node_modules/@angular/core/src/facade/async.d.ts
(10,28): error TS2307: Cannot find module 'rxjs/Observable'.
ERROR in /Users/honpery/personal_project/honpery_com/admin_rewrite/node_modules/@angular/core/src/facade/async.d.ts
(11,25): error TS2307: Cannot find module 'rxjs/Subject'.
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true
},
"buildOnSave": false,
"compileOnSave": false,
"exclude": [
"node_modules"
]
}
index.ts
import "es6-shim";
import "rx";
import {Component} from '@angular/core';
已經找到答案,函式庫用錯了,應該是rxjs而不是rx。
說是
rxjs/Observable
没找到,你装了rx
了么?npm install --save rxjs@5.0.0-beta.6
還有,再去掉
import "rx";
試試。最後,對照webpack+angular2搭環境看看還有哪裡有差別