Angular 4: module did not find error regarding RxJs

when building Angular app I get many errors like this, below is just the first

ERROR in ./~/@reactivex/rxjs/dist/cjs/Rx.js
Module not found: Error: Can't resolve './add/operator/filter' in 
'...\node_modules\@reactivex\rxjs\dist\cjs'
 @ ./~/@reactivex/rxjs/dist/cjs/Rx.js 70:0-32
 @ ./~/@reactivex/rxjs/index.js
 @ ./~/ri-api-client/dist/index.js
 @ ./src/app/core/api.service.ts
 @ ./src/$$_gendir/app/app.module.ngfactory.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

      

what am i missing?

+3


source to share


2 answers


Based on your error message, it appears that your import statement is incorrect. He complains that he didn't find things in node_modules / @ reactivex, but he must search in node_modules / rxjs.

Your import statement should look like this:



import 'rxjs/add/operator/filter';

      

+2


source


I had a similar error.

`ERROR in ./src/app/shared/giphy/giphy.service.ts`

      



Module not found: Error: Can't resolve 'rxjs/add/operator/map' in '/Users/ratna/opt/work/mine/development/investicore/ic-pms/pms-ui/src/app/shared/giphy'

ℹ 「wdm」: Failed to compile. ERROR in src/app/shared/giphy/giphy.service.ts(16,35): error TS2339: Property 'map' does not exist on type 'Observable<Object>'.

Ans solution for this npm install rxjs@6 rxjs-compat@6 --save

+6


source







All Articles