Error in error: metadata mismatch error for module .. /node_modules/angularfire2/index.d.ts, found version 4, expected 3,

Error in error: metadata mismatch error for module C: / projects / youtube- angular / firestore-app / node_modules / angularfire2 / index.d.ts, version 4 found, expected 3,

I have never seen this. I tried to uninstall everything and reinstall to the latest versions and still get this error. Someone else seems to have no such problem. So I assume that this is a local setting or my installation is wrong, but I can’t understand what this means.

package.json { "name": "firestore-app", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^4.2.4", "@angular/common": "^4.2.4", "@angular/compiler": "^4.2.4", "@angular/core": "^4.2.4", "@angular/forms": "^4.2.4", "@angular/http": "^4.2.4", "@angular/platform-browser": "^4.2.4", "@angular/platform-browser-dynamic": "^4.2.4", "@angular/router": "^4.2.4", "angularfire2": "^5.0.0-rc.4", "core-js": "^2.4.1", "firebase": "^4.6.2", "font-awesome": "^4.7.0", "jquery": "^3.2.1", "materialize-css": "^0.100.2", "rxjs": "^5.4.2", "zone.js": "^0.8.14" }, "devDependencies": { "@angular/cli": "1.4.7", "@angular/compiler-cli": "^4.2.4", "@angular/language-service": "^4.2.4", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "~3.2.0", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.7.0", "typescript": "~2.3.3" } } 
+9
angular firebase
source share
4 answers

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

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

+10
source share

In my case, I had to change the cli version and angularfire2 version

 npm install @angular/ cli@ version 1.2.1 --save npm install angularfire2@5.0.0-rc.3 --save 
+2
source share

I tried everything and it did not work. The only answer that helped me was to update all @ angular packages, such as @ angular / common, @ angular / compiler, @ angular / compiler-cli, "@ angular / core, etc. version (5.1.1) .

After that, I also need to update rxjs to the latest version (5.5.5).

What successfully compiled the -prod file.

0
source share

Addressing the same problem with "angular2-qrscanner"

Error in error: metadata mismatch error for module /node_modules/angular2-qrscanner/angular2-qrscanner.d.ts, found version 4, expected 3, character resolution in /src/app/modules/manage/device/device.module.ts resolving character in /src/app/.ts in the syntax Error (\ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js: 1725: 34) in simplifyInContext (\ node_modules \ @angular \ compiler \ bundles \ compiler.umd .js: 24953: 23) in StaticReflector.simplify (\ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js: 24965: 13) in StaticReflector.annotations (\ node_modules \ @angular \ compiler \ bundles \ compiler.umd .js: 24395: 41) in _getNgModuleMetadata (\ node_modules \ @angular \ compiler-cli \ src \ ngtools_impl.js: 138: 31) in _extractLazyRoutesFromStaticModule (\ node_modules \ @angular \ compiler-cli \ srs_jt \ ngpl : 26) in \ node_modules \ @angular \ compiler-cli \ src \ ngtools_imp l.js: 129: 27 in Array.reduce () in _extractLazyRoutesFromStaticModule (\ node_modules \ @angular \ compiler-cli \ src \ ngtools_impl.js: 128: 10) in Object.listLa zyRoutesOfModule (\ node_modules \ @angular comp cli \ src \ ngtools_impl.js: 53: 22) in a function.NgTools_InternalApi_NG_2.listLazyRoutes (\ node_modules \ @angular \ compiler-cli \ src \ ngtools_api.js: 91: 39) in AotPlugin._getLazygoolGloryGloryGlory webpack \ src \ plugin.js: 241: 66) in _donePromise.Promise.resolve.then.then.then.then.then (\ node_modules \ @ngtools \ webpack \ src \ plugin.js: 495: 24) at at process ._tickCallback (internal / process / next_tick.js: 188: 7)

webpack: Failed to compile.

0
source share

All Articles