簡體   English   中英

無法擴展接口“http.IncomingMessage”。 您指的是 'implements' 嗎?

[英]Cannot extend an interface 'http.IncomingMessage'. Did you mean 'implements'?

我一直在努力serve我的 angular 項目serve ,每次遇到一些錯誤時,我都會嘗試使用 google 找到答案,現在達到了一個點,我沒有找到任何有用的答案。 我下載了一個MEAN堆棧應用程序並嘗試運行,但現在出現以下錯誤

ERROR in ../node_modules/@types/connect/index.d.ts:21:42 - error TS2689: Cannot extend an interface 'http.IncomingMessage'. Did you mean 'implements'?

21     export class IncomingMessage extends http.IncomingMessage {

這是我的package.json文件

{
  "name": "opticare",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "build": "ng build",
    "ng": "ng",
    "start": "ng serve",
    "test": "ng test",
    "pree2e": "webdriver-manager update --standalone false --gecko false",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^8.2.14",
    "@angular/common": "^8.2.14",
    "@angular/compiler": "^8.2.14",
    "@angular/core": "^8.2.14",
    "@angular/forms": "^8.2.14",
    "@angular/http": "^7.2.16",
    "@angular/platform-browser": "^8.2.14",
    "@angular/platform-browser-dynamic": "^8.2.14",
    "@angular/router": "^8.2.14",
    "@auth0/angular-jwt": "^2.0.0",
    "@ng-bootstrap/ng-bootstrap": "^3.2.2",
    "@swimlane/ngx-charts": "^7.4.0",
    "angular-archwizard": "^3.0.0",
    "angular-datatables": "^6.0.0",
    "angular2-csv": "^0.2.5",
    "angular2-spinner": "^1.0.10",
    "bcrypt-nodejs": "0.0.3",
    "chalk": "^2.4.1",
    "chart.js": "^2.7.2",
    "core-js": "^2.4.1",
    "cron": "^1.8.2",
    "datatables.net": "^1.10.19",
    "datatables.net-dt": "^1.10.19",
    "express": "^4.16.3",
    "file-saver": "^1.3.8",
    "googleapis": "^47.0.0",
    "http-errors": "^1.6.3",
    "jodit-angular": "^1.0.86",
    "jquery": "^3.3.1",
    "jsonwebtoken": "^8.1.0",
    "jwt-decode": "^2.2.0",
    "lodash": "^4.17.10",
    "moment": "^2.22.2",
    "moment-timezone": "^0.5.21",
    "mongoose": "^5.8.9",
    "mongoose-paginate": "^5.0.3",
    "multer": "^1.3.0",
    "ng2-nouislider": "^1.7.7",
    "ngx-bootstrap": "^2.0.3",
    "ngx-chips": "^1.9.2",
    "ngx-toastr": "^6.4.0",
    "node-cron": "^1.2.1",
    "node-sass": "^4.13.1",
    "nodemailer": "^4.6.8",
    "nouislider": "^11.0.3",
    "rxjs": "^6.5.4",
    "rxjs-compat": "^6.0.0-rc.0",
    "shortid": "^2.2.8",
    "ts-helpers": "^1.1.1",
    "tslib": "^1.10.0",
    "twilio": "^3.39.3",
    "xlsx": "^0.13.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.23",
    "@angular/cli": "^8.3.23",
    "@angular/compiler-cli": "^8.2.14",
    "@types/datatables.net": "^1.10.12",
    "@types/jasmine": "~2.8.3",
    "@types/jquery": "^3.3.4",
    "@types/node": "~6.0.60",
    "@types/systemjs": "^0.20.5",
    "codelyzer": "^5.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.4.1",
    "karma-chrome-launcher": "~2.2.0",
    "typescript": "^3.4.5"
  }
}

@types/connect與包@types/node一起安裝。 版本 3.4.33 ( @types/connect@3.4.33 ) 似乎會導致您的問題。

我可以通過安裝最新的@types/node 來規避它

npm i @types/node@latest

有關更多信息,請參閱https://github.com/DefinitelyTyped/DefinitelyTyped/issues/41092

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM