VS2015:向tsconfig.json添加"watch":true导致JsErrorScriptException(0x30001)

编程入门 行业动态 更新时间:2024-10-28 10:23:52
本文介绍了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.

问题:

每次保存文件时都不会将它们编译(piled)到.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)

本文发布于:2023-11-16 22:27:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1607725.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:json   quot   tsconfig   JsErrorScriptException   watch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!