Open KLTR opened 6 years ago
Same problem here.
I fixed it by change version number from 3 to 4 in ./node_modules/angular2-flash-messages/module/index.js.map file.
@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"
}
}
@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.
@muskanstha 's solution worked for me.
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.
@nemanjawork solution worked! Thank you!
@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!
Still have this issue
Same still issue
@nemanjawork this solution worked perfectly for me. Not sure about the forRoot() though. Worked fine for me without it!
@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.
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: 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?
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.
here is my package.json :