Fixing: Can’t resolve ‘rxjs/add/operator/map’ error

We recently got the error Can't resolve 'rxjs/add/operator/map' after upgrading Angular v5 to v6 and after a bit googled, we have found rxjs migration that guides us to install both rxjs and rxjs-compat at ^6.0.0.

Here is the command to install the rxjs packages for fixing the error:

npm install rxjs@6 rxjs-compat@6 --save

After you install the above two packages, the error should go away.

Learn more about rxjs migration guide.