ngrx / store

RxJS powered state management for Angular applications, inspired by Redux
MIT License
3.9k stars 311 forks source link

Angular CLI Install ngrx - errors #451

Closed feischml closed 7 years ago

feischml commented 7 years ago

Hi guys,

I am trying to install ngrx libraries within Angular CLI project, but unfortunately the following messages/also errors appear:

npm install @ngrx/store --save cluj-squash@0.0.0 /Users/feischml/cluj-squash ├── UNMET PEER DEPENDENCY @angular/compiler@4.3.1 ├── UNMET PEER DEPENDENCY @angular/core@4.3.1 └── @ngrx/store@4.0.0

npm WARN @angular/compiler-cli@4.2.2 requires a peer of @angular/compiler@4.2.2 but none was installed. npm WARN @angular/compiler-cli@4.2.2 requires a peer of @angular/core@4.2.2 but none was installed.

After installation(with unmet peer error) and using the library at compilation a lot of errors appear in the following files: /@ngrx/store/src/utils.d.ts, /@ngrx/store/src/state.d.ts, /@ngrx/store/src/store_module.d.ts and others.

I have the following package versions installed:

ng --version Your global Angular CLI version (1.1.1) is greater than your local version (1.0.1). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".


/ \ | | / | | | | / △ \ | ' \ / ` | | | | |/ ` | '| | | | | | | / | | | | (| | || | | (| | | | |__| | | | // __| ||_, |_,||_,|| __|__|| |/ @ angular/cli: 1.0.1 node: 6.11.0 os: darwin x64 @ angular/common: 4.3.1 @ angular/compiler: 4.3.1 @ angular/core: 4.3.1 @ angular/forms: 4.3.1 @ angular/http: 4.3.1 @ angular/platform-browser: 4.3.1 @ angular/platform-browser-dynamic: 4.3.1 @ angular/router: 4.3.1 @ angular/cli: 1.0.1 @ angular/compiler-cli: 4.2.2"

Could you help resolving this?

Kind regards, Laszlo Feischmidt

jotatoledo commented 7 years ago

your angular packages should be the same version, the error isn't related to the store package.

feischml commented 7 years ago

@jotatoledo Hi Jose, What exactly do you mean?

Here is how my package.json file looks like: "dependencies": { "@ angular/common": "^4.3.1", "@ angular/compiler": "^4.3.1", "@ angular/core": "^4.3.1", "@ angular/forms": "^4.3.1", "@ angular/http": "^4.3.1", "@ angular/platform-browser": "^4.3.1", "@ angular/platform-browser-dynamic": "^4.3.1", "@ angular/router": "^4.3.1", "@ ngrx/store": "^4.0.0", "core-js": "^2.4.1", "rxjs": "^5.1.0", "zone.js": "^0.8.4" },

Although, when I install the store these messages appear: UNMET PEER DEPENDENCY @ angular/compiler@4.3.1 ├── UNMET PEER DEPENDENCY @ angular/core@4.3.1

When I install the effects also this appears. I will try to activate my ngrx classes again and see what happens.

Thanx, Laszlo

luchillo17 commented 7 years ago

@feischml Is it my imagination or your packages have an space between @ and the package name?

krjordan commented 7 years ago

@feischml: @jotatoledo means that your Angular packages should all match:

"@angular/common": "^4.3.1",
"@angular/compiler": :^4.3.1",

and so on, but your @angular/compiler-cli you are showing you have it set to version 4.2.2. You should change it to match the other angular packages:

"@angular/compiler-cli": "^4.3.1",

Also, not sure what errors this would throw if any, but your @angular/cli package is a bit out of date too. The current version is up to 1.2.4. I agree this doesn't seem to be related to the @ngrx/store package.

feischml commented 7 years ago

So I installed again the packages, also ngrx but the following error appear at compilation:

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/state.d.ts (20,84): Generic type 'StateActionPair' requires 3 type argument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/state.d.ts (20,142): Generic type 'ActionReducer<T, V, Action>' requires 3 type a rgument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/state.d.ts (20,165): Generic type 'StateActionPair' requires 3 type argument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/store.d.ts (21,31): ',' expected.

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/store.d.ts (25,46): ',' expected.

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/store.d.ts (25,78): Generic type 'ActionReducer<T, V, Action>' requires 3 type ar gument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (2,61): ',' expected.

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (2,81): Generic type 'ActionReducerMap' requires 3 type argument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (2,133): Generic type 'ActionReducer<T, V, Action>' requires 3 type ar gument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (12,62): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (12,109): Generic type 'ActionReducer<T, V, Action>' requires 3 type a rgument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (12,137): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/effects/src/actions.d.ts (4,32): ',' expected.

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/effects/src/actions.d.ts (7,40): Generic type 'Actions<V, Action>' requires 2 type argument (s).

ERROR in /Users/feischml/cluj-squash/src/app/roles/ngrx/effects/roles.effect.ts (11,26): Generic type 'Actions<V, Action>' requires 2 type argument (s).

Any ideas?

Thanx, Laszlo

jaceee commented 7 years ago

Is this related to #450 ? Maybe you need to update your version of TypeScript to 2.4.1

El mar., 25 de jul. de 2017 12:09, Laszlo Feischmidt < notifications@github.com> escribió:

So I installed again the packages, also ngrx but the following error appear at compilation:

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/state.d.ts (20,84): Generic type 'StateActionPair' requires 3 type argument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/state.d.ts (20,142): Generic type 'ActionReducer<T, V, Action>' requires 3 type a rgument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/state.d.ts (20,165): Generic type 'StateActionPair' requires 3 type argument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/store.d.ts (21,31): ',' expected.

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/store.d.ts (25,46): ',' expected.

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/store.d.ts (25,78): Generic type 'ActionReducer<T, V, Action>' requires 3 type ar gument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (2,61): ',' expected.

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (2,81): Generic type 'ActionReducerMap' requires 3 type argument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (2,133): Generic type 'ActionReducer<T, V, Action>' requires 3 type ar gument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (12,62): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (12,109): Generic type 'ActionReducer<T, V, Action>' requires 3 type a rgument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/store/src/utils.d.ts (12,137): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/effects/src/actions.d.ts (4,32): ',' expected.

ERROR in /Users/feischml/cluj-squash/node_modules/@ngrx/effects/src/actions.d.ts (7,40): Generic type 'Actions<V, Action>' requires 2 type argument (s).

ERROR in /Users/feischml/cluj-squash/src/app/roles/ngrx/effects/roles.effect.ts (11,26): Generic type 'Actions<V, Action>' requires 2 type argument (s).

Any ideas?

Thanx, Laszlo

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ngrx/store/issues/451#issuecomment-317803719, or mute the thread https://github.com/notifications/unsubscribe-auth/AExNHvZyUFCGO0Df27WidzmRJ4hXPt-xks5sRiFggaJpZM4OifLA .

brandonroberts commented 7 years ago

Visit https://gitter.im/ngrx/platform if you need more support

feischml commented 7 years ago

Solved with updating typescript to 2.4.0

Thanx @jaceee