I\'m building my first Angular Application. I\'m creating a new Angular application using this command ng new purchase-section
. But when I executing the application
Just remove ^
character from "rxjs": "^6.0.0"
from package.json
file and make it "rxjs": "6.0.0"
. It should work fine.
Update in package.json rxjs": "6.3.3"
in terminal 1. run npm update 2. run ng serve
It should compile successfully
Your package.json has following lines:
"rxjs": "^6.0.0",
"typescript": "~2.7.2"
This tells npm to install the following versions
rxjs: Latest version in version 6 series which is 6.4.0
typescript: Latest patched version in minor version 2.7 which is 2.7.2
Now RxJS module also installs the type definition files for TypeScript. The type definition file included in the rxjs module that got installed in your project is not compatible with typescript version installed in the same project.
So as a solution in your package.json file you can either bump up the version of Typescript to say 2.8 as
typescript: ^2.8.0
or bump down the version of ngrx to something like
ngrx: ~6.0.0
and
do a fresh npm install.
You can check the version number of the module installed by looking in following files:
node_modules/rxjs/package.json and
node_modules/typescript/package.json
Go to the project directory run: npm install rxjs@6.0.0 --save
You can update your npm
version to the latest, if it isn't, with:
npm update -g
Encountered this error with: rxjs/store: ^6.4.0 typescript: ~2.7.2 angular/cli ~6.0.0
Updated everything to the latest except rxjs rxjs/store: ^6.3.3 typescript: ~3.1.1 angular/cli ~7.0.3
Basically I created an blank new project (ng new newProject) and installed @ngrx/store which brought down v6.3.3. This worked for me.