gpt4 book ai didi

angular - Visual Studio 2015 RC3 TypeScript Intellisense 不再工作

转载 作者:搜寻专家 更新时间:2023-10-30 21:24:26 25 4
gpt4 key购买 nike

我正在使用 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"
]
}

这是我的package.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,但如果可能的话我想避免这样做.

编辑: 添加项目截图:

enter image description here

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

最佳答案

如果 Mica 回答的第 2 步是你的问题,但你无法再从 C:\Program Files (x86)\Microsoft Visual Studio 14.0\访问旧的 typescriptServices.js Common7\IDE\CommonExtensions\Microsoft\TypeScript 然后删除(或者备份以防万一)typescriptServices.js 文件并使用 TypeScript 进行修复 安装程序:https://www.microsoft.com/en-us/download/details.aspx?id=48593

关于angular - Visual Studio 2015 RC3 TypeScript Intellisense 不再工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39228507/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com