On my current Windows box, I have Node.js installed only in WSL – not on Windows itself.
When debugging a Node.js application from within a Visual Studio Code instance started from WSL, you may receive the following message:
While the dev experience certainly could be better, the solution is quite simple: Click on the “Open launch.json” button and add a configuration for “useWSL” with the value set to “true”.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Launch Program", | |
"program": "${workspaceFolder}\\entry-point.js", | |
"useWSL": true | |
} | |
] | |
} |