angular2-flash-messages icon indicating copy to clipboard operation
angular2-flash-messages copied to clipboard

Mimsatch version, found version 4 , expected 3.

Open KLTR opened this issue 8 years ago • 14 comments

everything was working fine and suddenly just stopped working . didn't change anything related to versions but still get this error. i tried changing to a different version of flash-messages but did not work.

ERROR in Error: Metadata version mismatch for module C:/Users/admin/Desktop/WebDev/MeanAuth/client/node_modules/angular2-flash-messages/module/index.d.ts, found version 4, expected 3, resolving symbol AppModule in C:/Users/admin/Desktop/WebDev/MeanAuth/client/src/app/app.module.ts, resolving symbol AppModule in C:/Users/admin/Desktop/WebDev/MeanAuth/client/src/app/app.module.ts, resolving symbol AppModule in C:/Users/admin/Desktop/WebDev/MeanAuth/client/src/app/app.module.ts
    at Error (native)
    at syntaxError (C:\Users\admin\Desktop\WebDev\MeanAuth\client\node_modules\@angular\compiler\bundles\compiler.umd.js:1729:34)
    at simplifyInContext (C:\Users\admin\Desktop\WebDev\MeanAuth\client\node_modules\@angular\compiler\bundles\compiler.umd.js:24979:23)
    at StaticReflector.simplify (C:\Users\admin\Desktop\WebDev\MeanAuth\client\node_modules\@angular\compiler\bundles\compiler.umd.js:24991:13)
    at StaticReflector.annotations (C:\Users\admin\Desktop\WebDev\MeanAuth\client\node_modules\@angular\compiler\bundles\compiler.umd.js:24418:41)
    at _getNgModuleMetadata (C:\Users\admin\Desktop\WebDev\MeanAuth\client\node_modules\@angular\compiler-cli\src\ngtools_impl.js:138:31)
    at _extractLazyRoutesFromStaticModule (C:\Users\admin\Desktop\WebDev\MeanAuth\client\node_modules\@angular\compiler-cli\src\ngtools_impl.js:109:26)
    at Object.listLazyRoutesOfModule (C:\Users\admin\Desktop\WebDev\MeanAuth\client\node_modules\@angular\compiler-cli\src\ngtools_impl.js:53:22)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\Users\admin\Desktop\WebDev\MeanAuth\client\node_modules\@angular\compiler-cli\src\ngtools_api.js:91:39)
    at AotPlugin._getLazyRoutesFromNgtools (C:\Users\admin\Desktop\WebDev\MeanAuth\client\node_modules\@ngtools\webpack\src\plugin.js:207:44)
    at _donePromise.Promise.resolve.then.then.then.then.then (C:\Users\admin\Desktop\WebDev\MeanAuth\client\node_modules\@ngtools\webpack\src\plugin.js:443:24)
    at process._tickCallback (internal/process/next_tick.js:109:7)

here is my package.json :

{
  "name": "client",
  "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",
    "angular2-flash-messages": "^2.0.4",
    "core-js": "^2.4.1",
    "rxjs": "^5.4.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.4.4",
    "@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"
  }
}

KLTR avatar Nov 30 '17 11:11 KLTR

Same problem here.

jacksylvane avatar Dec 01 '17 10:12 jacksylvane

I fixed it by change version number from 3 to 4 in ./node_modules/angular2-flash-messages/module/index.js.map file.

taweechok-li avatar Dec 02 '17 16:12 taweechok-li

@Nearkung Didn't work for me.

EDIT: Updated package.json to Angular 5 and running npm install fixed the problem

 {
  "name": "angular-src",
  "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": "^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",
    "angular2-flash-messages": "^2.0.4",
    "angular2-jwt": "^0.2.3",
    "core-js": "^2.4.1",
    "rxjs": "^5.5.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.5.5",
    "@angular/compiler-cli": "^5.0.0",
    "@angular/language-service": "^5.0.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "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.4.2"
  }
}

muskanstha avatar Dec 02 '17 18:12 muskanstha

@Nearkung's solution didn't work for me as well.

If for any reason you can't upgrade to angular 5.x as @muskanstha suggests, installing version 1.0.8 of the angular2-flash-messages will work. The only difference will be foregoing the forRoot() part when importing the module.

nemanjawork avatar Dec 06 '17 22:12 nemanjawork

@muskanstha 's solution worked for me.

kennethsilvere avatar Dec 08 '17 03:12 kennethsilvere

I'm getting a warning with "@angular/core": "^5.1.0",

npm WARN [email protected] requires a peer of @angular/core@~5.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN [email protected] requires a peer of @angular/compiler@~5.0.0 but none is installed. You must install peer dependencies yourself.

cbstodd avatar Dec 12 '17 21:12 cbstodd

@nemanjawork solution worked! Thank you!

Priiyam avatar Dec 23 '17 14:12 Priiyam

@Priiyam @cbstodd @nemanjawork @kennethsilvere @muskanstha @jacksylvane @KLTR I've just updated package so it should be fixed by now. Sorry for the delay - I don't have much time to maintain my repos these days! Let me know, if it works. Thanks to all for the feedback!

moff avatar Dec 26 '17 19:12 moff

Still have this issue

RichardZhu123 avatar Jan 29 '18 22:01 RichardZhu123

Same still issue

Harshad-Akhani avatar Feb 21 '18 14:02 Harshad-Akhani

@nemanjawork this solution worked perfectly for me. Not sure about the forRoot() though. Worked fine for me without it!

blake-edwards avatar May 21 '18 03:05 blake-edwards

@Nearkung Thankx! It worked with me by changed all 4 version numbers by 3 in all files inside ./angular-src/node_modules/angular2-flash-messages folder.

correa0inaiara avatar Jun 04 '18 01:06 correa0inaiara

inside node_modules\angular2-flash-messages changed all 4.0.0 to 3.0.0 like this: perfectly worked for me "devDependencies": { "@angular/common": "^3.0.0", "@angular/compiler": "^3.0.0", "@angular/compiler-cli": "^3.0.0", "@angular/core": "^3.0.0", "@angular/forms": "^3.0.0", "@angular/http": "^3.0.0", "@angular/platform-browser": "^3.0.0", "@angular/platform-browser-dynamic": "^3.0.0", "@angular/platform-server": "^3.0.0", "@angular/router": "^3.0.0", "@angular/upgrade": "^3.0.0", "@types/core-js": "^0.9.35", "@types/jasmine": "^2.5.41", "@types/node": "^7.0.0", "angular-in-memory-web-api": "~0.2.4", "bootstrap": "^3.3.6", "concurrently": "^3.1.0", "core-js": "^2.4.1", "lite-server": "^2.2.2", "reflect-metadata": "^0.1.10", "rxjs": "5.2.0", "systemjs": "0.19.47", "typescript": "^2.2.1", "zone.js": "^0.8.5" },

jeremydvera avatar Jun 30 '18 15:06 jeremydvera

@jeremydvera: I have changed version 4 to version3 but I still get the same error: node_modules/angular2-flash-messages/module/index.d.ts, found version 4, expected 3, I also get an error in bundleDependencies: "bundleDependencies": false, => Incorrect type. Expected "array". "deprecated": false, "description": "Angular 2 flash messages module", "devDependencies": {

Any idea how to solve this?

HenryITS avatar Jul 28 '18 22:07 HenryITS