请有人指导我如何解决这个问题。
Error Code:
Date: 2018-06-07T09:30:12.399Z
Hash: c8e1e30064a3aa0d6247
Time: 6037ms
chunk {main} main.js, main.js.map (main) 1.95 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 693 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.4 kB [entry] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 325 kB [initial] [rendered]
ERROR in node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
src/app/authguard.guard.ts(3,10): error TS2305: Module '"C:/Users/HP/Desktop/AngularWithSession/mean-app/node_modules/rxjs/Observable"' has no exported member 'Observable'.
i 「wdm」: Failed to compile.
答案 0 :(得分:1)
如果使用的节点版本高于6.x.x。尝试以下代码。它将解决此问题。
def dedup(lst):
mx = max(lst) + 1
dupcnt = 0
delcnt = 0
start = 0
for i in range(1, len(lst) + 1):
if i == len(lst) or (lst[i] != lst[start]):
lst[start - delcnt] = lst[start] + dupcnt * mx
delcnt += dupcnt
start = i
dupcnt = 0
else:
dupcnt += 1
dupidx = len(lst) - delcnt
for i in range(0, len(lst) - delcnt):
dupcnt = lst[i] // mx
if dupcnt:
lst[i] %= mx
for j in range(dupidx, dupidx+dupcnt):
lst[j] = lst[i]
dupidx += dupcnt
return lst
print(dedup([1,2,2,2,3,4,4,5]))
>>> [1, 2, 3, 4, 5, 2, 2, 4]
答案 1 :(得分:0)
从此包路径导入Observable:
import { Observable } from 'rxjs/Observable';
答案 2 :(得分:0)
如果您使用的是角度版本6,则可以使用
//创建和实用方法
import { Observable, Subject, pipe } from 'rxjs';
//运算符都来自rxjs /运算符
import { map, takeUntil, tap } from 'rxjs/operators';