angular-cli: upgrading to rxjs to 6.0.0-beta.1 fails with Error: Can't resolve 'rxjs/operator/share'
Versions
Angular CLI: 1.7.3
Node: 9.9.0
OS: darwin x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.7.3
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0
Repro steps
- Step 1
ng new test
- Step 2
According to RxJS Update Guide https://goo.gl/osWFzo
in package.json replace
"rxjs": "^5.5.6"
with
"rxjs": "^6.0.0-beta.1",
"rxjs-compat": "^6.0.0-beta.1",
- Step 3
ng serve
Observed behavior
$ ng serve
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Date: 2018-03-24T19:09:06.172Z
Hash: 5362f398b275ad9aa305
Time: 5380ms
chunk {inline} inline.bundle.js (inline) 3.85 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 17.9 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 549 kB [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 41.5 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 7.87 MB [initial] [rendered]
ERROR in ./node_modules/@angular/core/esm5/core.js
Module not found: Error: Can't resolve 'rxjs/operator/share' in 'test/node_modules/@angular/core/esm5'
Desired behavior
App should start normally
Mention any other details that might be useful (optional)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (1 by maintainers)
npm install rxjs@6 rxjs-compat@6 --save
firstly changed in package.json rxjs oldest versione rxjs “6.0.0-rc.0” and then run npm install rxjs-compat --save
@nhhockeyplayer see what the new import paths should be here.
@nhhockeyplayer
As @samherrmann pointed out, the import paths you specified are incorrect, ‘rxjs/Observable’ becomes just ‘rxjs’.
@rahulbhooteshwar
I would make sure your dependencies are cleanly upgraded, by this i mean delete your package-lock.json and your node_moduels directory and redo your
npm install
command, i’ve had issues in the past with packages not actually installing correctly because the package-lock.json file has an old version of packages in it.for me this didn’t work yet, as I struggle with
since 2 days now.