I am currently upgrading angular 4 to angular 6 code. I have installed \"rxjs\": \"^6.3.2\" and un-installed rxjs-compact as I have migrated the code to use the new rxjs ope
npm install --save rxjs-compat
import { Observable } from 'rxjs'
run server ng serve worked for Me
As, Jandro Rojas, already said, installing rxjs-compat dependency it's only a temporary walkaround. In the future, you still need to fix that. The best solution is to use an Angular update guide https://update.angular.io/ because of some mistakes can be fixed automatically.
From my experience with errors "Cannot find module 'rxjs-compat/Observable'", "Cannot find module 'rxjs-compat'" and etc.
import { Observable } from 'rxjs/Observable'
To:
import { Observable } from 'rxjs'
If you use RxJS observables classes or etc, you need to update your code. Use this guide -> RxJS v5.x to v6 Update Guide
Check carefully your dependencies, it should be updated too to use the newest RxJs. In my case "ngx-bootstrap" was outdated.
I am using Angular 10,this method works for me.
npm install --save rxjs-compat
you should import observable this way:-
import { Observable } from 'rxjs/Observable';
npm install --save rxjs-compat
and run the server again with ng serve
This works for me.
I have got same above error, to resolve the issue enter this command in you CLI:
Then after import: import { Observable } from 'rxjs';
Those who have this error while creating a salesforce project in VSCode, should ensure that the command - npm install rxjs@6.3.2 --save && npm install rxjs-compat@6.3.2 --save
are installed in - C:\Program Files\Salesforce CLI\client\node_modules directory