Angular-cli: Cannot find module 'rxjs/symbol/observable' on ng serve

Created on 16 Feb 2017  路  11Comments  路  Source: angular/angular-cli

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

beta 31

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

ng serve

The log given by the failure.

Normally this include a stack trace and some more information.

Cannot find module 'rxjs/symbol/observable'
Error: Cannot find module 'rxjs/symbol/observable'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at globalScope (D:\node_modules\@angular\core\bundles\core.umd.js:7:85)
at Object. (D:\node_modules\@angular\core\bundles\core.umd.js:10:2)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (D:\Google Drive\School\KdG\2e jaar\Front End\3e periode\apiProject\node_modules\@angular\cli\models\webpack-config.js:4:27)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (D:\Google Drive\School\KdG\2e jaar\Front End\3e periode\apiProject\node_modules\@angular\cli\tasks\serve.js:10:26)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Class.run (D:\Google Drive\School\KdG\2e jaar\Front End\3e periode\apiProject\node_modules\@angular\cli\commands\serve.js:74:27)
at Class. (D:\Google Drive\School\KdG\2e jaar\Front End\3e periode\apiProject\node_modules\@angular\cli\ember-clilib\models\command.js:134:17)
at process._tickCallback (internal/process/next_tick.js:103:7)

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

Most helpful comment

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

This solves the all angular 6 problems regarding Rxjs...

All 11 comments

Steps I took to resolve Issue:

  • Uninstalled angular cli npm uninstall @angular/cli -g
  • Installed rxJS npm install rxjs
  • Cleared cache npm cache clean
  • Installed angular cli npm install @angular/cli -g

The new release (beta.32-3) has fixed these missing deps.

npm install rxjs -g
npm cache clean
resolved my problem

Replace
import { Observable } from 'rxjs/observable'; # Incorrect
to
import { Observable } from 'rxjs/Observable'; # Correct - UPPERCASE 'O'

It worked for me! :)

@smartworld-konoha Ugh..... that was exactly my problem too. Fixing the case fixed it for me.

for newer npm versions do
npm cache verify

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

This solves the all angular 6 problems regarding Rxjs...

The case fix proposed by @smartworld-konoha worked for me because my team members had created a project using Observable on Windows (case insensitive) and I was running it on Linux (case sensitive). shakes fist in air

npm install --save rxjs-compat

Its working for me.

npm install -g @angular/[email protected]

resolved my problem

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings