模块的元数据版本不匹配... angular-flash-messages,任何解决方案

时间:2017-12-08 16:59:28

标签: angularjs flash-message

出错的错误:模块/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/angular2-flash-messages/module/index.d.ts的元数据版本不匹配,找到版本4,预期3,在/Users/ip/Sites/SmartShoeApp/angular-src/src/app/app.module.ts中解析符号AppModule,在/ Users / ip / Sites / SmartShoeApp / angular-src / src中解析符号AppModule /app/app.module.ts,在/Users/ip/Sites/SmartShoeApp/angular-src/src/app/app.module.ts中解析符号AppModule     在SyntaxError.BaseError [作为构造函数](/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@angular/compiler/bundles/compiler.umd.js:1597:31)     在新的SyntaxError(/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@angular/compiler/bundles/compiler.umd.js:1795:20)     在simplifyInContext(/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@angular/compiler/bundles/compiler.umd.js:25774:27)     在StaticReflector.simplify(/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@angular/compiler/bundles/compiler.umd.js:25786:17)     在StaticReflector.annotations(/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@angular/compiler/bundles/compiler.umd.js:25282:64)     at _getNgModuleMetadata(/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@angular/compiler-cli/src/ngtools_impl.js:126:31)     at _extractLazyRoutesFromStaticModule(/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@angular/compiler-cli/src/ngtools_impl.js:101:26)     at Object.listLazyRoutesOfModule(/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@angular/compiler-cli/src/ngtools_impl.js:52:22)     在Function.NgTools_InternalApi_NG_2.listLazyRoutes(/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@angular/compiler-cli/src/ngtools_api.js:78:39)     在AotPlugin._getLazyRoutesFromNgtools(/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@ngtools/webpack/src/plugin.js:241:66)     at _donePromise.Promise.resolve.then.then.then.then.then(/Users/ip/Sites/SmartShoeApp/angular-src/node_modules/@ngtools/webpack/src/plugin.js:495:24)     在     at process._tickCallback(internal / process / next_tick.js:188:7)

OS: mac OS high sierra

的package.json:

{   “名字”:“meanauthapp”,

“version”:“1.0.0”,

“description”:“均值堆栈应用”,

“main”:“app.js”,

“scripts”:{     “test”:“echo”错误:未指定测试\“&&& exit 1”,

"start": "node app"

},

“依赖项”:{     “表达”:“*”,

"mongoose": "*",

"bcryptjs": "*",

"cors": "*",

"jsonwebtoken": "*",

"body-parser": "*",

"passport": "*",

"passport-jwt": "*"

},

“作者”:“ip”,

“许可证”:“ISC”,

“devDependencies”:{

"@angular/cli": "^1.5.5"

} }

2 个答案:

答案 0 :(得分:0)

我今天在angular4应用程序上解决了这个问题。 我已经在package.json中设置了1.0.8版本,它现在适用于我:

"angular2-flash-messages": "1.0.8"

答案 1 :(得分:0)

在package.json文件中使用“angular2-flash-messages”:“^ 1.0.5”。