angular - 错误 TS2440 (TS) 导入声明与 'PluginConfig' 的本地声明冲突

标签 angular visual-studio

我正在尝试在 Visual Studio 2017 中运行我的应用程序,但不断收到错误消息:

 "Error TS2440  (TS) Import declaration conflicts with local declaration of 'PluginConfig'"

我尝试降级我的 typescript ,但错误并没有消失。下面是我的 package.json 文件:
{
  "name": "frontend",
  "version": "0.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": "^5.2.4",
    "@angular/cdk": "^5.2.1",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/flex-layout": "^5.0.0-beta.14",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^5.2.1",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "ajv": "^6.0.0",
    "angular2-text-mask": "^9.0.0",
    "angular5-time-picker": "^1.0.8",
    "bootstrap": "4.3.1",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "jquery": "^1.9.1",
    "ngx-mask": "^2.9.6",
    "popper.js": "^1.12.9",
    "rxjs": "^5.5.6",
    "text-mask-addons": "^3.7.2",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "1.6.7",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^2.0.4",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.3.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}

以下是 angular/cli 版本的屏幕截图:

enter image description here

我尝试在 Visual Studio 2017 和 2019 中打开应用程序,但在两个版本的 Visual Studio 中都遇到相同的错误。我还尝试在 Visual Studio 本身中更改 typescript 版本,但这也不起作用。下面是 Visual Studio Typescript 版本的屏幕截图:

enter image description here

任何解决此错误的帮助将不胜感激。

最佳答案

显然,这是大于 3.6.4 的最新版本的 Typescript [s] 的问题。据我所知,在我使用的 3.7 或 3.8 版本中没有修复它。
您可以将以下内容添加到根文件夹中的 tsconfig.json 以消除错误:

"compilerOptions": {
   ...,
   "skipLibCheck": true
}
此线程中提供了此解决方案:
https://github.com/angular/protractor/issues/5348

关于angular - 错误 TS2440 (TS) 导入声明与 'PluginConfig' 的本地声明冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60746305/

相关文章:

angular - Angular有一个签名板可以将其保存到图像中吗?

html - 在 Bootstrap css 网格中展开列移动其他列

html - Angular 键值管道 : argument type is not assignable to parameter type

visual-studio - 如何删除 Visual Studio Marketplace 发布者?

c# - 找不到程序集“mscorlib,版本 = 2.0.5.0

angular - 如何在 Angular 8 生产版本上压缩文件

javascript - 在 Angular 中解析来自异步函数的数据时出现空白图表

sql - "Order By"使用参数作为列名

c# - WPF 设计器错误声明当应用 StaticResource 时我的自定义 UserControl 为 "Could not create an instance of type..."

c - Visual Studio 中的嵌套静态库?