Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ngrx/[email protected] requires a peer of @angular/core@^6.0.0 while upgrading to angular 7

I tried to migrate Angular 6 application to angular 7 application and have got the following warning messsage

npm WARN @ngrx/[email protected] requires a peer of @angular/core@^6.0.0 but none is installed.
You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular/core@^6.0.0 but none is installed.
You must install peer dependencies yourself.

What does that mean ?

Does it mean that there is no compatible store for angular 7 ?

Will my store not work ?

like image 437
Tom Avatar asked Oct 24 '18 22:10

Tom


People also ask

Is NgRx necessary for Angular?

NgRx is a popular solution in the Angular ecosystem if you are building complex web applications with sophisticated state management. Characteristics of the need for NgRx are many user interactions and multiple data sources. NgRx is a good choice, if: the state should be accessed by many components and services.

Where is NgRx store stored?

Where Does NgRx Store Data? NgRx stores the application state in an RxJS observable inside an Angular service called Store. At the same time, this service implements the Observable interface.


2 Answers

Update:

NgRx is updated to 6.1.2 to resolve bugs and for compatibility with angular 7.

So according to https://github.com/ngrx/platform/issues/1397, you can ignore the peer dependencies and it should work with angular 7.

install:

npm install @ngrx/[email protected]

If you want to get rid of these warning you can go with @ngrx/store@7 by installing the Nightly builds this way:

npm install github:ngrx/store-builds

You are required then to have git installed in your system.

But keep in mind that @ngrx/store@7 still a beta release.

In the above given link, the reason why they apgraded to NgRx 6.1.2 is that the @ngrx/router-store has a bug with angular 7.

So upgrading to NgRx 6.1.2 make it usable and compatible with angular 7 and you can ignore the peer dependencies.

like image 52
HDJEMAI Avatar answered Sep 20 '22 15:09

HDJEMAI


You should be able to solve with the following command,

 ng update @ngrx/store --next --force
like image 42
Sajeetharan Avatar answered Sep 22 '22 15:09

Sajeetharan