Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular Visual Studio 2015 RC3 TypeScript Intellisense不再工作_Angular_Typescript_Visual Studio 2015_Intellisense - Fatal编程技术网

Angular Visual Studio 2015 RC3 TypeScript Intellisense不再工作

Angular Visual Studio 2015 RC3 TypeScript Intellisense不再工作,angular,typescript,visual-studio-2015,intellisense,Angular,Typescript,Visual Studio 2015,Intellisense,我正在为VS2015 1.8.1.0测试版使用TypeScript 1.8.10和TypeScript工具。 另外,我使用的是VS2015 RC3 我试图升级到TypeScript 2.0,但我遇到了完全相同的问题,所以我回到了TypeScript 1.8。 我尝试修复VS2015,更改tsconfig.json的“target”和“module”选项,卸载整个项目并在项目文件中设置TypeScript选项,尝试升级TypeScript工具,等等;但我仍然会发现这些错误: 我的TypeScrip

我正在为VS2015 1.8.1.0测试版使用TypeScript 1.8.10和TypeScript工具。 另外,我使用的是VS2015 RC3

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

我的TypeScript文件找不到@angular包(是的,它们在我的node_module文件夹中),我甚至得到了实验性装饰错误,尽管我的tsconfig.json中有“experimentalDecorators”:true选项。 在下面的屏幕截图中可以看到,TypeScript库中有很多错误:lib.d.ts和lib.es6.d.ts

问题是我的构建编译没有任何问题,但是我有无数的intellisense错误,我不能再用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"
  ]
}
{
  "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"
  }
}
这是我的包。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"
  ]
}
{
  "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"
  }
}
下面是我无数智能感知错误的截图:

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

编辑:添加项目截图:


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

我仍然不知道问题出在哪里,很可能是Visual Studio配置文件中的某个TypeScript配置出错,但我通过卸载并重新安装Visual Studio 2015 RC3解决了我的问题。

升级到typescript 2.0.3后,我也遇到了同样的问题。但我最终还是通过编辑.jsproj文件来管理它。我将此条目添加到.jsproj文件中(在一些导入说明之后)


2
然而,还有一些事情,我以前必须解决:

1) 您可能在几周/几个月前按照步骤替换了typescriptService.js?如果是这样,请用您的(希望是现有的)备份再次替换它

2) 下载Visual Studio的Typescript并安装它

3) 通过工具->扩展和更新检查VS中的KB修补程序更新。安装它

4) 尝试弄清楚intellisense是否再次工作(只需创建一个新的Web/Typescript项目)。如果它在您想要的项目中不起作用,请尝试如上所述添加PropertyGroup


希望有帮助:)

如果Mica的答案的第2步是您的问题,但您不再能够从
C:\Program Files(x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript
访问旧的
typescriptServices.js
,然后删除(或者备份以防万一)
typescriptServices.js
文件和
Repair
使用
TypeScript
安装程序:

我猜您的项目中没有node\u modules文件夹。如果有,也不要包括该文件夹(通过右键单击它并说include in project)在您的项目中。

只需修复您必须安装一次的typescript文件。这对我有用。
右键单击先前安装的typescript备份文件并以管理员身份运行,然后单击修复按钮。重新打开项目并查看intelli sense的.ts文件

项目结构是什么样子的?我使用的是相同的工具,它对我很有用(除了愚蠢的TS1219错误“装饰程序的实验支持…”),这不会消失,并且与正确解析tsconfig文件有关。在我的项目中,我在项目中包含了package.json、tsconfig.json和typings.json文件,但保留了根文件夹(
/typings
/node\u模块
)排除和intellisense工作我用我的项目截图编辑了这个问题。它们是项目的根本,以前工作得很好…我想可能是因为某些TypeScript 2.0配置把我的Visual Studio搞砸了,但我不能确定…是的,我在TS2.0上遇到了很多问题,我最终回滚到了h在VS2015重新开始工作之前,我想做大量的注册表黑客(它找不到TSC的正确路径),我相信将TypeScript升级到2.0会改变很多VS文件,比如“Microsoft.TypeScript.targets”而且完全打破了智能感知…而且,我发现了一些新的东西,我将编辑我的帖子。我仍然很难过…要明确的是-这个问题是关于更新3的发行候选吗?通常,当人们谈论“Visual Studio X RC Y”他们指的是原始产品的预RTM预览。但我怀疑您是否在使用2016年8月的Visual Studio 2015预发布版,因为它在去年7月进行了RTM。非常感谢!为我解决了这个问题。