Error: Metadata version mismatch
ERROR in Error: Metadata version mismatch for module /giant/cormoran/mgp-web/node_modules/@angular/material/core/typings/index.d.ts, found version 4, expected 3, resolving symbol AppModule in /giant/cormoran/mgp-web/src/app/app.module.ts, resolving symbol AppModule in /giant/cormoran/mgp-web/src/app/app.module.ts
Hello! It seem you used the old version of @angular/material package; Try npm install @angular/material@latest --save npm install @angular/cdk@latest --save
thanks i think that did the trick :)
I have the same issue and @vida25 response did not work for me.
ERROR in Error: Metadata version mismatch for module /Users/lars/sites/foo-bar-frontend/node_modules/@angular/material/core/typings/index.d.ts, found version 4, expected 3, resolving symbol AppModule in /Users/lars/sites/foo-bar-frontend/src/app/app.module.ts, resolving symbol AppModule in /Users/lars/sites/foo-bar-frontend/src/app/app.module.ts
My package.json file:
{
"name": "foo-bar-frontend",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"build": "ng build",
"e2e": "ng e2e",
"lint": "ng lint",
"ng": "ng",
"prestart": "ng build --prod && ./node_modules/.bin/ngc",
"start": "ts-node src/server.ts",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.4.6",
"@angular/cdk": "^5.0.0-rc0",
"@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/material": "^5.0.0-rc0",
"@angular/platform-browser": "^4.2.4",
"@angular/platform-browser-dynamic": "^4.2.4",
"@angular/platform-server": "^4.4.6",
"@angular/router": "^4.2.4",
"core-js": "^2.4.1",
"rxjs": "^5.4.2",
"webpack": "^3.8.1",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.4.9",
"@angular/compiler-cli": "^4.2.4",
"@angular/language-service": "^4.2.4",
"@types/jasmine": "^2.6.2",
"@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"
}
}
Facing the same issue
ERROR in Metadata version mismatch for module C:/Users/Afsar/ProjectNova_Website/node_modules/angular2-cool-storage/index.d.ts, found version 4, expected 3, resolving symbol AppModule in C:/Users/Afsar/ProjectNova_Website/src/app/app.module.ts, resolving symbol AppModule in C:/Users/Afsar/ProjectNova_Website/src/app/app.module.ts
I also have the same issue, even with latest @angular/cdk(^5.0.0-rc0) and @angular/material(^5.0.0-rc0)
ERROR in Error: Metadata version mismatch for module /Users/engine/node_modules/@angular/material/core/typings/index.d.ts, found version 4, expected 3, resolving symbol AppModule in /Users/engine/src/app/app.module.ts, resolving symbol AppModule in /Users/engine/src/app/app.module.ts
any ideas?
@javierarocena, @afsar-infobeans, @TisLars: upgrading only @angular/material and @angular/cdk seems not be enough. Update all your dependencies to5.0.x version (I mean all: angular, angular-material and devDependencies such as compiler-cli etc.). That worked for me.
"@angular/cdk": "^5.0.0-rc0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/material": "^5.0.0-rc0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"@angular/cli": "^1.5.0",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
@reod How can i update "@angular/compiler", "@angular/common"?
@reod But want to check what are the dependencies for angular 5.Need to change a lot in my angular 4 current application
Below is my package.json { "name": "nova-angular", "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.4.3", "@angular/cdk": "^2.0.0-beta.12", "@angular/common": "^4.4.3", "@angular/compiler": "^4.4.3", "@angular/core": "^4.4.3", "@angular/forms": "^4.4.3", "@angular/http": "^4.4.3", "@angular/material": "^2.0.0-beta.12", "@angular/platform-browser": "^4.4.3", "@angular/platform-browser-dynamic": "^4.4.3", "@angular/router": "^4.4.3", "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.29", "angular2-cool-storage": "^3.0.2", "angular2-jwt": "^0.2.3", "bootstrap": "^3.3.7", "classlist.js": "^1.1.20150312", "core-js": "^2.5.0", "ng2-cookies": "^1.0.12", "ng2-truncate": "^1.3.10", "rxjs": "^5.4.2", "tslint-fix": "^0.1.0", "zone.js": "^0.8.16" }, "devDependencies": { "@angular/cli": "1.3.2", "@angular/compiler-cli": "^4.4.3", "@angular/language-service": "^4.4.3", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "^8.0.26", "codelyzer": "^3.1.2", "jasmine-core": "~2.8.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~1.7.0", "karma-chrome-launcher": "~2.2.0", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "karma-junit-reporter": "^1.2.0", "karma-phantomjs-launcher": "^1.0.4", "protractor": "~5.1.2", "ts-node": "~3.3.0", "tslint": "~5.7.0", "typescript": "~2.4.2", "typings": "^2.1.1" } }
pls suggest
Updating dependencies worked for me!
Modified lines in package.json:
"dependencies": {
"@angular/material": "^5.0.0-rc0",
"@angular/cdk": "^5.0.0-rc0",
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"rxjs": "^5.5.2"
}
"devDependencies": {
"typescript": "^2.5.3"
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
}

i had also updated my node/npm to latest: 8.9.0 / 5.5.12:
@angular/cli: 1.4.7 node: 8.9.0 os: win32 x64 @angular/animations: 4.4.6 @angular/cdk: 2.0.0-beta.12 @angular/common: 4.4.6 @angular/compiler: 4.4.6 @angular/core: 4.4.6 @angular/forms: 4.4.6 @angular/http: 4.4.6 @angular/material: 2.0.0-beta.12 @angular/platform-browser: 4.4.6 @angular/platform-browser-dynamic: 4.4.6 @angular/router: 4.4.6 @angular/cli: 1.4.7 @angular/compiler-cli: 4.4.6 @angular/language-service: 4.4.6 typescript: 2.3.4
I updated everything I could to 5.0.0 but still couldn't get it to work...
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/cdk": "^5.0.0-rc0",
"@angular/cli": "1.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/material": "^5.0.0-rc0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"lodash": "^4.17.4",
"ng2-inline-editor": "^0.1.1-alpha.14",
"ng2-toastr": "^4.0.1",
"protractor": "~5.1.0",
"rxjs": "^5.1.0",
"ts-node": "~2.0.0",
"tslint": "~5.3.2",
"typescript": "^2.6.1",
"zone.js": "^0.8.18"
}
When I update compiler-cli to 5 I start getting this instead
Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "5.0.0".
The RC release is targeted for Angular5, so you will need to be on that version to use this release.
Thanks @amcdnl ! Works like a charm now!
I am having the same issue, and reinstalling over existing and manually changing the package.json didn't help. Could anyone provide an example of the fastest way to rebuild from the command line once I clone my repository to a fresh folder? I know it sounds newb, but all the npm install switches and version combinations are killing me.
maybe delete contents of node_modules folder and re-install ? npm install @angular/material@latest --save npm install @angular/cdk@latest --save etc... for all the dependencys u have
@amcdnl Thanks, It Worked!
After removing nodes_module and reinstall, I also had to run:
npm install --save-dev html-webpack-plugin webpack webpack-dev-server
Guys it resolved after reinstalling the Angular CLI and latest npm. However it needs some manual efforts to create the project structure again. It doesn't worked when i import same work space which is available earlier (as it has old version labels in package.json) .
Here are the commands for your reference to reinstall NPM and CLI. For NPM-- - > npm install npm@latest –g For CLI ---- > To update/re-install angular CLI latest, use the below commands from node cmd npm uninstall -g angular-cli npm cache clean npm install -g @angular/cli@latest
ERROR in Error: Metadata version mismatch for module D:/minprogram/angularDome/node_modules/ngx-filesaver/index.d.ts, found version 4, expected 3, resolving symbol AppModule in D:/minprogram/angularDome/src/app/app.module.ts, resolvin g symbol AppModule in D:/minprogram/angularDome/mobileNg/src/app/app.module.ts Please help me…
For me problem was fixed after removing node_modules folder and installing packages with latest version from scratch.