简体   繁体   English

Visual Studio Code Node.js调试失败-请求``启动'':无法启动

[英]Visual studio code nodejs debug failure - request 'launch': cannot launch

On my windows 10 with nodejs and visualstudio code installed, I just can't debug with VS code even with sample code by Microsoft- https://code.visualstudio.com/docs/runtimes/nodejs 在我的Windows 10安装和的NodeJS的VisualStudio代码,我只是无法与VS代码由Microsoft-调试甚至示例代码https://code.visualstudio.com/docs/runtimes/nodejs

The error is " request 'launch': cannot launch target(reason:spawn node ENOENT) ", which looks like to be some configuration issue, and checked nodejs did install under C:\\Program Files\\nodejs. 错误是“ 请求'启动':无法启动目标(原因:生成节点ENOENT) ”,这似乎是一些配置问题,并且检查的nodejs确实安装在C:\\ Program Files \\ nodejs下。

I saw one same question on stackoverflow - visual studio code nodejs request 'launch': cannot launch target (reason: spawn node ENOENT) , but there's no help answer, would anyone have suggestion on this? 我在stackoverflow上看到了一个相同的问题-Visual Studio代码nodejs请求“启动”:无法启动目标(原因:生成节点ENOENT) ,但是没有帮助的答案,有人对此有建议吗? Thanks in advance! 提前致谢!

I am pretty sure this is because node has not been added to your PATH. 我很确定这是因为尚未将节点添加到您的PATH。 That is to say, you can't just type "Node" anyway in command line and have it correctly open your Node installation. 也就是说,您不能只在命令行中键入“ Node”并使其正确打开Node安装。

Double check that Node is correctly added to your path first, then try again. 首先仔细检查Node是否已正确添加到您的路径,然后重试。

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

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