angular-cli: Cannot find module 'rxjs/operators/map' when running any ng command

Getting the following error when trying to run any ng commands.

`ng --version module.js:471 throw err; ^

Error: Cannot find module ‘rxjs/operators/map’ at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (C:\work\fs\test\test-fspg\node_modules@angular-devkit\core\src\json\schema\registry.js:15:15) at Module._compile (module.js:570:32) at Object.Module._extensions…js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)`

My project was using cli version 1.4.5, Started happening after a fresh npm install Tried with latest 1.6.4 and got the same error. It was working fine last week.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 9
  • Comments: 21 (2 by maintainers)

Commits related to this issue

Most upvoted comments

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

I tried installing new version of rxjs and it worked for me npm install --save rxjs@5.5.2

My issue resolved , after running below command, npm install rxjs@6.2.0 rxjs-compat@6.2.0 --save

Thanks for saving my time.

Updating rxjs package from 5.4.3 to 5.5.6 fixed the issue.

npm install --save rxjs@5.6.0

Thanks!! I have same error too

just before install rxjs and rxjs-compat packages (current version 6.2.0) npm install rxjs@6.2.0 rxjs-compat@6.2.0 --save

after server buil success

The Alpha fails, as does 5.5.6

I tried @5.5.5 and that resolves. Available versions:

6.0.0-alpha.1, 6.0.0-alpha.0, 5.5.6, 5.5.5, 5.5.4, 5.5.3, 5.5.2, 5.5.1, 5.5.0, 5.5.0-beta.7, 5.5.0-beta.5, 5.5.0-beta.4, 5.5.0-beta.3, 5.5.0-beta.2, 5.5.0-beta.1, 5.5.0-beta.0, 5.4.3, 5.4.2, 5.4.1, 5.4.0, 5.3.3, 5.3.1, 5.3.0, 5.2.1-smooth, 5.2.0, 5.1.1, 5.1.0, 5.0.3, 5.0.2, 5.0.1, 5.0.0, 5.0.0-rc.5, 5.0.0-rc.4, 5.0.0-rc.3, 5.0.0-rc.2, 5.0.0-rc.1, 5.0.0-beta.12, 5.0.0-beta.11, 5.0.0-beta.10, 5.0.0-beta.9, 5.0.0-beta.8, 5.0.0-beta.7, 5.0.0-beta.6, 5.0.0-beta.5, 5.0.0-beta.4, 5.0.0-beta.3, 5.0.0-beta.2, 5.0.0-beta.1, 5.0.0-beta.0, 5.0.0-alpha.14, 5.0.0-alpha.13, 5.0.0-alpha.12, 5.0.0-alpha.11, 5.0.0-alpha.10

I used yarn to reinstall. It worked.

Same for me too, the project.json that I had contained: “rxjs”: “5.4.2”, Changing it to the version included with ‘ng new’ scaffolding solved the problem: “rxjs”: “^5.5.2”,

npm install --save rxjs@5.6.0 will fix the issue… It worked for me

As of now to get rid of this issue, please run npm install rxjs@5.5.6 globally on system after npm install, if you dont need to change code