这可能是一个太具体的错误,无法获得帮助,但我在这里发帖寻找有关该怎么做的任何建议。
我正在将网站从以前的布局迁移到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历史记录中抓取以前版本的网站,似乎没有任何工作。任何人都有这方面的经验吗?
答案 0 :(得分:0)
看起来你使用的是旧版本。您必须更新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