请大家帮忙看看,憋了一上午了,在线等,先谢谢了!
错误信息:
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';
답을 찾았습니다. 잘못된 라이브러리를 사용했습니다. rx가 아니라 rxjs여야 합니다.
rxjs/Observable
을 찾을 수 없다고 뜹니다.rx
를 설치하셨나요?npm install --save rxjs@5.0.0-beta.6
rxjs/Observable
没找到,你装了rx
了么?npm install --save rxjs@5.0.0-beta.6
还有,再去掉
또한import "rx";
import "rx";
를 제거해 보세요.