尝试为网站提供服务时发生元数据错误
这可能是一个太具体的错误以获得帮助,但我在此处张贴寻找有关如何操作的任何建议。尝试为网站提供服务时发生元数据错误
我正在将网站从以前的布局迁移到Angular 4的新布局(具有类似的功能)。在我以前的机器上,所有事情都按预期运行。我收到一台新机器,现在每当我尝试为网站提供服务时,我都会收到一些错误。
ERROR in Error: Metadata version mismatch for module C:/Users/drose/Angular/node_modules/@ng-idle/keepalive/index.d.ts, found version 4, expected 3, resolving symbol AppModule in C:/Users/drose/Angular/src/app/app.module.ts, resolving symbol AppModule in C:/Users/drose/Angular/src/app/app.module.ts, resolving symbol AppModule in C:/Users/drose/Angular/src/app/app.module.ts at syntaxError (C:\Users\drose\Angular\node_modules\@angular\compiler\bundles\compiler.umd.js:1729:34)
at simplifyInContext (C:\Users\drose\Angular\node_modules\@angular\compiler\bundles\compiler.umd.js:24979:23)
at StaticReflector.simplify (C:\Users\drose\Angular\node_modules\@angular\compiler\bundles\compiler.umd.js:24991:13)
at StaticReflector.annotations (C:\Users\drose\Angular\node_modules\@angular\compiler\bundles\compiler.umd.js:24418:41)
at _getNgModuleMetadata (C:\Users\drose\Angular\node_modules\@angular\compiler-cli\src\ngtools_impl.js:138:31)
at _extractLazyRoutesFromStaticModule (C:\Users\drose\Angular\node_modules\@angular\compiler-cli\src\ngtools_impl.js:109:26)
at Object.listLazyRoutesOfModule (C:\Users\drose\Angular\node_modules\@angular\compiler-cli\src\ngtools_impl.js:53:22)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\Users\drose\Angular\node_modules\@angular\compiler-cli\src\ngtools_api.js:91:39)
at AotPlugin._getLazyRoutesFromNgtools (C:\Users\drose\Angular\node_modules\@ngtools\webpack\src\plugin.js:241:66)
at _donePromise.Promise.resolve.then.then.then.then.then (C:\Users\drose\Angular\node_modules\@ngtools\webpack\src\plugin.js:495:24)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
我手动尝试安装每个依赖,重新安装不同版本的节点,从出GitHub的历史,似乎没有任何工作抓住网站的早期版本。任何人都有更多的经验?
回答:
它看起来像你使用旧版本。你必须更新你的package.json
"@angular/cdk": "^4.0.0", "@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
// update whatever other modules to latest version
如需进一步信息,新版本检查this
以上是 尝试为网站提供服务时发生元数据错误 的全部内容, 来源链接: utcz.com/qa/265804.html