Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visual studio code nodejs request 'launch': cannot launch target (reason: spawn node ENOENT)

When I use visual studio code to debug a nodejs app. visual studio code tell me request 'launch': cannot launch target (reason: spawn node ENOENT)

enter image description here

My nodejs version is 4.2.4

like image 405
ChenPei Avatar asked Jan 15 '16 09:01

ChenPei


2 Answers

Managed to get past this when running on Windows by specifying npm.cmd instead of npm in the VS code debug configuration like so

"runtimeExecutable": "npm.cmd",
like image 114
ebhh2001 Avatar answered Oct 26 '22 23:10

ebhh2001


Some discussions are posted in this here

How do I debug "Error: spawn ENOENT" on node.js?

Especially, the following points should be checked

  • Ensure the environment variable PATH is set
  • PATHEXT environment variable that can cause certain calls to spawn to not work on Windows.
like image 37
zangw Avatar answered Oct 26 '22 23:10

zangw