久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

angular.js - angular2+webpack編譯錯誤

瀏覽:179日期:2024-03-16 15:23:09

問題描述

請大家幫忙看看,憋了一上午了,在線等,先謝謝了!錯誤信息:

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’;

問題解答

回答1:

已經找到答案,庫用錯了,應該是rxjs而不是rx。

回答2:

說是rxjs/Observable沒找到,你裝了rx了么?npm install --save rxjs@5.0.0-beta.6

還有,再去掉import 'rx';試試。

最后,對照webpack+angular2搭環境看看還有哪里有區別

標簽: web
相關文章:
主站蜘蛛池模板: 通州市| 韶关市| 珠海市| 安泽县| 扶绥县| 翁牛特旗| 拜泉县| 敖汉旗| 北流市| 庆安县| 克山县| 广汉市| 双辽市| 攀枝花市| 罗山县| 合阳县| 大竹县| 吉安市| 博乐市| 车致| 桦甸市| 东至县| 海伦市| 肇源县| 镇江市| 汪清县| 海盐县| 普陀区| 称多县| 柯坪县| 久治县| 稻城县| 康定县| 兴国县| 额济纳旗| 安吉县| 定结县| 当阳市| 南城县| 新竹县| 威海市|