Angular 4, angularfire2, Metadata version mismatch

こ雲淡風輕ζ 提交于 2019-11-30 18:14:38

I tried above solutions but it didn't solve my issue. I tried the below steps & it solved my issue.

The issue actually occurred when npm install angularfire2 firebase --save command was run. Below dependencies were added in package.json

"angularfire2": "^5.0.0-rc.4",
"firebase": "^4.7.0"

Actual issue here is due to the version of angularfire2. We need to have angularfire2": "^5.0.0-rc.3 instead of angularfire2": "^5.0.0-rc.4. I am not aware as to why this version is having issue.

Below are the steps for resolution:

STEP 1: Uninstall angularfire2 & firebase

npm uninstall angularfire2 firebase --save

STEP 2: Install angularfire2 5.0.0-rc.3 version

npm install angularfire2@5.0.0-rc.3 --save

STEP 3: Install firebase

npm install firebase --save

STEP 4: Check dependencies added in package.json

"angularfire2": "^5.0.0-rc.3",
"firebase": "^4.7.0"

STEP 5: Execute ng serve

ng serve

This solves the issue & application compiles successfully.

This is how I solved this problem. Follow the steps as i have listed:

STEP 1: Uninstall previous angularfire2 installed pacakge

npm uninstall angularfire2

STEP 2: Install angularfire2 5.0.0-rc.3

npm install angularfire2@5.0.0-rc.3 --save

STEP 3: Check your package.json

Make sure you have the following lines under dependencies in package.json

"angularfire2": "^5.0.0-rc.3",
"firebase": "^4.6.0",

This is how i solved the problem.

I solved it

Had to set firebase and angularfire2 to this:

"firebase":"4.6.0", "angularfire2": "5.0.0-rc.3"

but then I got another error:
"@angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '@angular/compiler-cli'

A npm install fixed it.

I faced the same problem but solved it by changing the release candidate on angularfire2 back to 3 like "angularfire2": "^5.0.0-rc.3" from "angularfire2": "^5.0.0-rc.4" in your package.json file. then delete node modules and run npm i or npm install.

Or you can unintall angularfire2 make sure you also remove it from your package.json and package.json.lock files. reinstall it and specify the release candidate like npm install angularfire2@5.0.0-rc.3 --save.

angularfire2 5.0.0-rc.4 should work with firebase 4.5.0 and angular 5.0.0

Check angularfire2 package.json :

"firebase": "^4.5.0"

I had the same issue. Downgrade the angularfire2's version to "5.0.0-rc.3" worked with me.

"angularfire2": "^5.0.0-rc.3"

Follow the steps - will be solved the problem
1. npm uninstall angularfire2 firebase --save
2. npm install angularfire2@5.0.0-rc.3 --save
3. npm install firebase --save
4. ng serve

This error occured to me as well when I do ng serve after yarn upgarde that installed:

  angularfire2@5.0.0-rc.5-next
  firebase@4.13.1

Downgrading to angularfire2@5.0.0-rc.3 solved the problem:

  yarn remove angularfire2
  yarn add angularfire2@5.0.0-rc.3

angularfire2@5.0.0-rc.4 didn't work with new firabase, not feeling right to see this type of endless upgrade trouble.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!