cipchk / ngx-notify

一个无须依赖HTML模板、极简Angular通知组件。
https://cipchk.github.io/ngx-notify/
MIT License
79 stars 14 forks source link

ERROR in Error: Metadata version mismatch for module for version 1.0.2 #2

Closed alaahong closed 6 years ago

alaahong commented 6 years ago

Hi, Thanks for your works, seems it's a great plug-in. npm: 5.3.0 node:8.4.0 Angular: 4.4.6 Angular-cli: 1.5.3 I try to involve that into my project, but met below error:


ERROR in Error: Metadata version mismatch for module ../node_modules/ngx-notify/index.d.ts, found version 4, expected 3, resolving symbol AppModule in ../app/app.module.ts, resolving symbol AppModule in ../app/app.module.ts, resolving symbol AppModule in ../app/app.module.ts
    at syntaxError (..\node_modules\@angular\compiler\bundles\compiler.umd.js:1729:34)
    at simplifyInContext (..\node_modules\@angular\compiler\bundles\compiler.umd.js:24979:23)
    at StaticReflector.simplify (..\node_modules\@angular\compiler\bundles\compiler.umd.js:24991:13)
    at StaticReflector.annotations (..\node_modules\@angular\compiler\bundles\compiler.umd.js:24418:41)
    at _getNgModuleMetadata (..\node_modules\@angular\compiler-cli\src\ngtools_impl.js:138:31)
    at _extractLazyRoutesFromStaticModule (..\node_modules\@angular\compiler-cli\src\ngtools_impl.js:109:26)
    at Object.listLazyRoutesOfModule (..\node_modules\@angular\compiler-cli\src\ngtools_impl.js:53:22)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (..\node_modules\@angular\compiler-cli\src\ngtools_api.js:91:39)
    at AotPlugin._getLazyRoutesFromNgtools (..\node_modules\@ngtools\webpack\src\plugin.js:241:66)
    at _donePromise.Promise.resolve.then.then.then.then.then (..\node_modules\@ngtools\webpack\src\plugin.js:495:24)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Both met in bg build and ng serve

I try to downgrade the versison as 1.0.1, no exception any more. So I guess there shoud be any change impacting on this. Thanks.

cipchk commented 6 years ago

please provider your package.json.

or, trying use in angular4:

"ngx-notify": "1.0.1"

tips: both delete node_moduls & package-lock.json

alaahong commented 6 years ago

Hi, here is the package.json

{
  "name": "cio-dashboard",
  "version": "1.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.4.6",
    "@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/platform-browser": "^4.4.6",
    "@angular/platform-browser-dynamic": "^4.4.6",
    "@angular/router": "^4.4.6",
    "@types/js-base64": "^2.3.0",
    "@wkoza/ngx-upload": "^1.0.0-alpha.7",
    "angular-datatables": "^4.4.1",
    "bootstrap": "^4.0.0-beta",
    "core-js": "^2.4.1",
    "datatables.net": "^1.10.16",
    "datatables.net-buttons": "^1.4.2",
    "datatables.net-buttons-dt": "^1.4.2",
    "datatables.net-dt": "^1.10.16",
    "datatables.net-responsive": "^2.2.0",
    "datatables.net-responsive-dt": "^2.2.0",
    "echarts": "^3.7.1",
    "font-awesome": "^4.7.0",
    "html2canvas": "^0.5.0-beta4",
    "jquery": "^3.2.1",
    "moment": "^2.18.1",
    "mzmu": "^1.8.14",
    "ng-sidebar": "^6.0.4",
    "ng2-file-upload": "^1.2.1",
    "ng2-loading-animate": "0.0.17",
    "ng2-select2": "^1.0.0-beta.10",
    "ngx-bootstrap": "^2.0.0-beta.8",
    "ngx-echarts": "^1.2.4",
    "ngx-loading": "^1.0.8",
    "ngx-month-picker": "^1.1.0",
    "ngx-notify": "^1.0.1",
    "ngx-ui-switch": "^1.4.4",
    "pdfmake": "^0.1.32",
    "popper.js": "^1.12.6",
    "rxjs": "^5.4.2",
    "screenfull": "^3.3.1",
    "select2": "^4.0.3",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.5.3",
    "@angular/compiler-cli": "^4.4.6",
    "@angular/language-service": "^4.4.6",
    "@types/datatables.net": "^1.10.7",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/jquery": "^3.2.12",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.1.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.8.0",
    "typescript": "^2.3.4"
  }
}
cipchk commented 6 years ago
"ngx-notify": "1.0.1"
alaahong commented 6 years ago

Sorry, I just directly paste current package.json which is working well with 1.0.1 ... Actually, while I first npm install with 1.0.2, it thrown the exception same as 1F. Then I have to downgrade to 1.0.1...

ehdwns980416 commented 6 years ago

Try this.(I solved that problem with this command) npm install ngx-notify@1.0.1 --save