简体   繁体   English

通过Visual Studio 2017中的任务运行器资源管理器调试节点js

[英]debug node js through task runner explorer in Visual Studio 2017

I am using Visual Studio 2017 with npm task runner explorer. 我正在将Visual Studio 2017与npm TaskRunner Explorer一起使用。 Through the task runner I am executing node scripts with the node command. 通过任务运行程序,我正在使用node命令执行节点脚本。 How can I have Visual Studio debugging the invoked Javascript? 如何让Visual Studio调试调用的Javascript?

From the nodejstools Advanced-Debugging wiki : nodejstools Advanced-Debugging Wiki

It is also possible to attach to a locally running Node.exe process, if it was started with debugging enabled, using the '--debug' command line argument: 如果它是在启用调试的情况下启动的,则还可以使用'--debug'命令行参数将其附加到本地运行的Node.exe进程:

So if you are using your VS2017 task runner explorer to run npm tasks with the NPM Task runner extension you'll have to adjust your npm scripts task to something like this : 因此,如果您使用VS2017 TaskRunner Explorer来通过NPM TaskRunner扩展程序运行npm任务,则必须将npm scripts任务调整为如下所示:

"scripts": {
    "test": "node --debug .\\cool-script.js"
  },

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM