VS2015:向tsconfig.json添加"watch":true导致JsErrorScriptException(0x30001) [英] VS2015: Adding "watch": true to tsconfig.json causing JsErrorScriptException (0x30001)

查看:225
本文介绍了VS2015:向tsconfig.json添加"watch":true导致JsErrorScriptException(0x30001)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 VS2015社区更新3 版本14.0.25424.00中创建了一个虚拟基础项目. (使用此出色的教程: aspnet-core- web-api-angularjs-2 ).

I have created a dummy basic project in VS2015 Community Update 3, Version 14.0.25424.00. (Using this great tutorial: aspnet-core-web-api-angularjs-2 ).

这个angular-2项目有一些.ts文件.

This angular-2 project has some .ts files.

问题:

每次保存文件时都不会将它们编译(.compiled)到.js文件中,而是一次仅在BUILD 时才编译.ts文件. SERVER-SIDE项目. (在Visual Studio中单击F5).

Instead of being transpiled ("compiled") to .js files every time a file is being saved, the .ts files being transpiled once and only at BUILD time of the SERVER-SIDE project. (clicking F5 from visual studio).

我在Google上搜索了它,发现我应该添加手表":true 到tsconfig.json文件:

I google it and found out that I should add "watch": true to the tsconfig.json file:

 {
  "compilerOptions": {
    "noImplicitAny": false,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es5",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "system",
    "moduleResolution": "node",
    "watch": true
  },
  "exclude": [
    "node_modules",
    "wwwroot/lib"
  ]
}

但是,现在我在构建时间遇到了一个错误: 错误'JsErrorScriptException(0x30001)'. ASPNETCoreAngular2Demo C:\ Visual Studio 2015 \ Projects \ ASPNETCoreAngular2Demo \ src \ ASPNETCoreAngular2Demo \未知输出1

However, now I am getting an error at BUILD time: Error 'JsErrorScriptException (0x30001)'. ASPNETCoreAngular2Demo C:\Visual Studio 2015\Projects\ASPNETCoreAngular2Demo\src\ASPNETCoreAngular2Demo\Unknown output 1

根据帖子,VS2015更新2中的解决方案是添加到tsconfig文件:

According to this post, the solution in VS2015 update 2 is to add to the tsconfig file:

"compileOnSave": true

但是,在我的更新3版本中,这不适用于我.

However, this didn't work for me in my update 3 version.

从cmd运行以下命令:

From the cmd I run the following:

>tsc -v Version 1.0.3.0

>tsc -v Version 1.0.3.0

我认为这已经很老了,但是我不知道如何更新它,因为正在运行:

Which I think is pretty old but I don't know how to update it, because running:

>npm install -g typescript@* --save

没有更改当前版本.

您有什么建议? 我很绝望..

What do you suggest? I am desperate..

TNX

推荐答案

哇,可怜的微软..

这里的问题是,在安装VS2015时,我得到了TypeScript 1.8, 但是它没有更新Windows 10的PATH env变量, 所以我实际上是在使用1.0版本.

The issue here is that on installing VS2015, I got TypeScript 1.8, But it didn't update the PATH env variable of Windows 10, So I was actually using the 1.0 version.

我必须借助此帖子手动进行更新.

I had to update it manually with the help of THIS POST .

(请注意此处使用"compileOnSave"的注释:在win10操作系统上为true).

(be aware of the comment there to use "compileOnSave": true on win10 os).

现在工作了(-;

这篇关于VS2015:向tsconfig.json添加"watch":true导致JsErrorScriptException(0x30001)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆