Here are different ways you can install RxJs:
npm install rxjs
To import the entire core set of functionality:
import * as rxjs from 'rxjs'; rxjs.of(1, 2, 3);
To import only what you need using pipeable operators:
import { of } from 'rxjs'; import { map } from 'rxjs/operators'; of(1,2,3).pipe(map(x => x + '!!!')); // etc
To use with globally imported bundle:
const { of } = rxjs; const { map } = rxjs.operators; of(1,2,3).pipe(map(x => x + '!!!')); // etc
If you receive an error like error TS2304: Cannot find name 'Promise' or error TS2304: Cannot find name 'Iterable' when using RxJS you may need to install a supplemental set of typings.
typings install es6-shim --ambient
If you're not using typings the interfaces can be copied from /es6-shim/es6-shim.d.ts.
Add type definition file included in tsconfig.json or CLI argument.
To install this library via npm version 3, use the following command:
npm install @reactivex/rxjs
If you are using npm version 2 before this library has achieved a stable version, you need to specify the library version explicitly:
npm install @reactivex/rxjs@5.0.0-beta.1
For CDN, you can use unpkg. Just replace version with the current version on the link below:
For RxJS 5.0.0-beta.1 through beta.11: https://unpkg.com/@reactivex/rxjs@version/dist/global/Rx.umd.js
For RxJS 5.0.0-beta.12 and higher: https://unpkg.com/@reactivex/rxjs@version/dist/global/Rx.js
For RxJS 6.0.0 and higher: https://unpkg.com/@reactivex/rxjs@version/dist/global/rxjs.umd.js
© 2015–2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.
Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0.
https://rxjs.dev/guide/installation