Typescript 从 1.8.10 更新到 4.6.4 build:Invalid '参考

Typescript updated from 1.8.10 to 4.6.4 build:Invalid 'reference

我正在将我的 Typescript 从 1.8.10 升级到 4.6.4。我可以看到新版本在 Typescript 的包中,但我不确定为什么我会收到所有错误

Build:Invalid 'reference' directive syntax. C:\WebProjects\ITF\Web\node_modules\typescript\lib\lib.es6.d.ts Web 21

package.json

  "dependencies": {
    "@angular/cli": "^6.2.1",
    "@angular/common": "~2.2.0",
    "@angular/compiler": "~2.2.0",
    "@angular/core": "~2.2.0",
    "@angular/forms": "~2.2.0",
    "@angular/http": "~2.2.0",
    "@angular/platform-browser": "~2.2.0",
    "@angular/platform-browser-dynamic": "~2.2.0",
    "@angular/router": "~3.2.0",
    "@angular/upgrade": "~2.2.0",
    "@ckeditor/ckeditor5-angular": "^1.2.3",
    "a": "^2.1.2",
    "angular-in-memory-web-api": "0.1.15",
    "core-js": "^2.4.1",
    "debug": "^4.1.1",
    "gulp": "^4.0.2",
    "typescript": "^4.6.4",
    "gulp-cli": "^2.3.0",
    "gulp4-run-sequence": "^1.0.1",
    "moment": "2.17.1",
    "reflect-metadata": "^0.1.8",
    "rxjs": "5.0.0-beta.12",
    "systemjs": "0.19.39",
    "zone.js": "^0.6.25"
  },
  "devDependencies": {
    "gulp-comment-swap": "0.0.10",
    "gulp-concat": "^2.6.0",
    "gulp-htmlclean": "^2.7.22",
    "gulp-ignore": "^2.0.1",
    "gulp-inject": "^5.0.5",
    "gulp-inline-ng2-template": "^5.0.1",
    "gulp-insert": "^0.5.0",
    "gulp-jspm": "^0.5.13",
    "gulp-rename": "^1.2.2",
    "gulp-replace": "^0.5.4",
    "gulp-rimraf": "^0.2.0",
    "gulp-shell": "^0.8.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-tslint": "^8.1.4",
    "gulp-tslint-stylish": "^1.1.1",
    "gulp-typedoc": "^2.2.3",
    "gulp-typescript": "^2.13.0",
    "gulp-uglify": "^3.0.2",
    "gulp-util": "^3.0.2",
    "gulp-watch": "^4.0.1",
    "highcharts": "^10.0.0",
    "html-loader": "^0.4.0",
    "immutable": "^3.8.1",
    "install": "^0.4.1",
    "json-loader": "^0.5.3",
    "moment": "^2.29.2",
    "npm": "^8.6.0",
    "redux": "^3.5.2",
    "rimraf": "^2.4.4",
    "run-sequence": "^1.1.5",
    "superstatic": "^7.1.0",
    "ts-loader": "^0.7.2",
    "tsc": "^1.20150623.0",
    "tsconfig-lint": "^0.12.0",
    "tslint": "^6.1.3",
    "tslint-loader": "^2.1.0",
    "typedoc": "^0.2.2",
    "typings": "^1.3.2"
  },
  "jspm": {
    "dependencies": {
      "typescript": "npm:typescript@1.8.10"
    }
  }

更新包

{
  "name": "ITF",
  "version": "1.0.0",
  "scripts": {
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w"
  },
  "dependencies": {
    "@angular/cli": "13.3.4",
    "@angular/common": "~2.2.0",
    "@angular/compiler": "~2.2.0",
    "@angular/core": "~2.2.0",
    "@angular/forms": "~2.2.0",
    "@angular/http": "~2.2.0",
    "@angular/platform-browser": "~2.2.0",
    "@angular/platform-browser-dynamic": "~2.2.0",
    "@angular/router": "~3.2.0",
    "@angular/upgrade": "~2.2.0",
    "@types/core-js": "^2.5.5",
    "@types/node": "^7.10.14",
    "@types/react": "^18.0.8",
    "a": "^2.1.2",
    "angular-in-memory-web-api": "^0.1.15",
    "core-js": "^2.6.12",
    "debug": "^4.3.4",
    "gulp": "^4.0.2",
    "gulp-cli": "^2.3.0",
    "gulp4-run-sequence": "^1.0.1",
    "reflect-metadata": "^0.1.13",
    "rxjs": "^5.0.0-beta.12",
    "systemjs": "^0.19.39",
    "zone.js": "^0.6.26"
  },
  "devDependencies": {
    "gulp-comment-swap": "0.0.10",
    "gulp-concat": "^2.6.0",
    "gulp-htmlclean": "^2.7.22",
    "gulp-ignore": "^2.0.1",
    "gulp-inject": "^5.0.5",
    "gulp-inline-ng2-template": "^5.0.1",
    "gulp-insert": "^0.5.0",
    "gulp-jspm": "^0.5.13",
    "gulp-rename": "^1.2.2",
    "gulp-replace": "^0.5.4",
    "gulp-rimraf": "^0.2.0",
    "gulp-shell": "^0.8.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-tslint": "^8.1.4",
    "gulp-tslint-stylish": "^1.1.1",
    "gulp-typedoc": "^2.2.3",
    "gulp-typescript": "^2.13.0",
    "gulp-uglify": "^3.0.2",
    "gulp-util": "^3.0.2",
    "gulp-watch": "^4.0.1",
    "highcharts": "^10.0.0",
    "html-loader": "^0.4.0",
    "immutable": "^3.8.1",
    "install": "^0.4.1",
    "json-loader": "^0.5.3",
    "moment": "^2.29.3",
    "npm": "^8.6.0",
    "redux": "^3.5.2",
    "rimraf": "^2.4.4",
    "run-sequence": "^1.1.5",
    "superstatic": "^7.1.0",
    "ts-loader": "^0.7.2",
    "tsc": "^1.20150623.0",
    "tsconfig-lint": "^0.12.0",
    "tslint": "^6.1.3",
    "tslint-loader": "^2.1.0",
    "typedoc": "^0.2.2",
    "typescript": "^4.6.4"
  },
  "jspm": {
    "dependencies": {
      "typescript": "npm:typescript@1.8.10"
    }
  }
}

我建议您更新依赖项。 也许最好一次做一个。

我在您的列表中检查的第一个(也是唯一一个)依赖项已弃用。 typings https://www.npmjs.com/package/typings

从那开始。 :)

如果您仍然需要有关该错误的帮助,请尝试查找并发布更多相关信息。