Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Right way to upgrade RxJS to latest version?

When trying to install the latest version of RxJS,

I used npm install rxjs as explained in this documentation: https://github.com/reactivex/rxjs

But I got these warnings:

npm warn @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed.

You must install peer dependencies yourself.

enter image description here

So it looks like RxJS is upgraded but not to the latest version.

In the output we see that there is a latest one which is RxJS 5.5.0

Is there any better npm command line to upgrade to the latest version ?

like image 455
HDJEMAI Avatar asked Dec 10 '17 22:12

HDJEMAI


People also ask

How do I install the latest version of RxJS?

We have to install the following packages inside rxjsproj/ folder to test RxJS in browser. Run the following npm command: npm install --save-dev babel-loader @babel/core @babel/preset-env webpack webpack-cli webpack-dev-server.

How do I upgrade to RxJS 6?

x to RxJS 6 is as follows: First, you need to make sure that you are using the latest version (RxJS 5.5) in your project. If that's not the case just update to RxJS 5.5 before updating to RxJS 6. Next, you need to install RxJS 6 and also the rxjs compatibility layer package, rxjs-compat .

What version of RxJS do I need for angular 14?

14 ng update @angular/core rxjs 6.3.


1 Answers

EDIT 2020

The easiest way to force upgrade any package would be to do append an @latest to the required package.

In our use case it would be

npm install rxjs@latest

This would force your current setup to install the latest stable version available.

Bear in mind that the latest version might not always be compatible with all the libraries in use. In case a specific range is needed due to compatibility issues you should install specific versions(e.g for the use case)

npm install [email protected]

In the previous answer it was also included the -g flag. This would (as for any npm package installation) install the specified package globally in your system and not only on the current project

Previous Answer

You can always try to force the version by doing

npm install -g [email protected]

Or you can have a more modern approach and use yarn :)

NOTE

Since the release of npm 5.x the comment about yarn is no longer necessarily true :)

like image 54
Hugo Noro Avatar answered Sep 28 '22 05:09

Hugo Noro