moff / angular2-flash-messages

Angular 2 flash messages module
52 stars 21 forks source link

Mimsatch version, found version 4 , expected 3. #34

Open KLTR opened 6 years ago

KLTR commented 6 years ago

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"
  }
}
jacksylvane commented 6 years ago

Same problem here.

taweechok-li commented 6 years ago

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

muskanstha commented 6 years ago

@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"
  }
}
nemanjawork commented 6 years ago

@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.

kennethsilvere commented 6 years ago

@muskanstha 's solution worked for me.

cbstodd commented 6 years ago

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

npm WARN angular2-flash-messages@2.0.4 requires a peer of @angular/core@~5.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN angular2-flash-messages@2.0.4 requires a peer of @angular/compiler@~5.0.0 but none is installed. You must install peer dependencies yourself.

Priiyam commented 6 years ago

@nemanjawork solution worked! Thank you!

moff commented 6 years ago

@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!

RichardZhu123 commented 6 years ago

Still have this issue

Harshad-Akhani commented 6 years ago

Same still issue

blake-edwards commented 6 years ago

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

correa0inaiara commented 6 years ago

@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.

jeremydvera commented 6 years ago

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" },

HenryITS commented 6 years ago

@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?