ng serve-无法重新声明块作用域变量'ngDevMode'

时间:2018-12-27 22:21:21

标签: angular

开始ng服务时,我看到错误:

ERROR in lista-zadan-repo/node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error         
TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.
node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.

我只是在容忍Angular,很难说在错误发生之前做了什么。也许Angular更新也可能是一个问题。我尝试了与此类似的其他stackoverflow主题中的所有解决方案,但没有帮助。 我想解决问题而不是启动新项目。

tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "importHelpers": true,
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],

    "lib": [
      "es2017",
      "dom"
    ]
  }
}


ng --version

Angular CLI: 7.1.4
Node: 8.11.3
OS: win32 x64
Angular: 7.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.11.4
@angular-devkit/build-angular     0.11.4
@angular-devkit/build-optimizer   0.11.4
@angular-devkit/build-webpack     0.11.4
@angular-devkit/core              7.1.4
@angular-devkit/schematics        7.1.4
@ngtools/webpack                  7.1.4
@schematics/angular               7.1.4
@schematics/update                0.11.4
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.23.1

0 个答案:

没有答案