Visual Studio 2015 RC3 TypeScript Intellisense 不再工作

2023-11-30

我正在使用 TypeScript 1.8.10 和 TypeScript Tools for VS2015 1.8.1.0 Beta。 另外,我正在使用 VS2015 RC3

我尝试升级到 TypeScript 2.0,但遇到了完全相同的问题,所以我又回到了 TypeScript 1.8。 我尝试修复 VS2015,更改 tsconfig.json“目标”和“模块”选项,卸载整个项目并在项目文件中设置 TypeScript 选项,尝试升级 TypeScript 工具,等等;但我仍然收到这些错误:

我的 TypeScript 文件找不到 @angular 包(是的,它们在我的 node_module 文件夹中),我什至收到实验装饰器错误,即使我有“experimentalDecorators”:true我的 tsconfig.json 中的选项。 正如您在下面的屏幕截图中看到的那样,TypeScript 库存在很多错误:lib.d.ts 和 lib.es6.d.ts

问题是我的构建编译没有任何问题,但我遇到了无数的智能感知错误,而且我无法再使用 TypeScript 进行编码,所以我现在真的无法再工作了......

这是我的tsconfig.json :

{
  "compilerOptions": {
    "outDir": "./wwwroot/app/",
    "target": "es6",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true
  },
  "exclude": [
    "wwwroot",
    "node_modules",
    "typings",
    "typings/main",
    "typings/main.d.ts"
  ]
}

这是我的包.json :

{
  "name": "angular2-quickstart",
  "version": "1.0.0",
  "scripts": {
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "license": "ISC",
  "dependencies": {
    "@angular/common": "2.0.0-rc.5",
    "@angular/compiler": "2.0.0-rc.5",
    "@angular/core": "2.0.0-rc.5",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "2.0.0-rc.5",
    "@angular/router": "3.0.0-rc.1",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.5",

    "angular2-in-memory-web-api": "0.0.15",

    "systemjs": "0.19.36",
    "core-js": "^2.4.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.11",
    "zone.js": "^0.6.12"
  },
  "devDependencies": {
    "typescript": "^1.8.10",
    "typings": "^1.0.4",
    "gulp": "^3.9.1",
    "path": "^0.12.7",
    "gulp-clean": "^0.3.2",
    "gulp-concat": "^2.6.0",
    "gulp-typescript": "^2.13.1",
    "gulp-tsc": "^1.1.5",
    "run-sequence": "^1.2.2"
  }
}

这是我无数的智能感知错误的屏幕截图:

enter image description here

任何帮助将不胜感激,我真的对这些错误感到迷失,我不知道该怎么办了...我想我可以完全重新安装 VS 2015,但如果可能的话我想避免这样做。

EDIT :添加项目截图:

enter image description here

EDIT 2 :我发现,如果我将 tsconfig.json 目标选项更改为“es5”,我会在 @Angular 包中遇到构建错误,即使它之前没有任何问题。它不会改变 es6 和 es5 库的任何内容。


如果 Mica 的答案的第 2 步是您的问题,但您无法再访问旧的typescriptServices.js from C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript然后删除(或者备份以防万一)typescriptServices.js文件和RepairTypeScript安装人员:https://www.microsoft.com/en-us/download/details.aspx?id=48593

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Visual Studio 2015 RC3 TypeScript Intellisense 不再工作 的相关文章

随机推荐