Angular 4: Module not found error regarding RxJs

Based on your error message it seems that your import statement is not correct. It complains about not finding things in node_modules/@reactivex, but it should be looking in node_modules/rxjs.

Your import statement should look like this:

import 'rxjs/add/operator/filter';

RXJS changed their syntax in version 6+

The new solution should be:

import { filter } from 'rxjs/operators';

not

import 'rxjs/add/operator/filter';

More details here: https://www.academind.com/learn/javascript/rxjs-6-what-changed/


I had similar error..

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

Module not found: Error: Can't resolve 'rxjs/add/operator/map' in '/Users/user1/opt/work/mine/development/ic/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 that is npm install rxjs@6 rxjs-compat@6 --save