New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to debug Node program using WSL #54593
Comments
This is a complex setup which is not yet supported. |
I think this should work when removing For debugging such a setup, I use the extension WSL workspaceFolder and add the following to my lauch configurations:
Example that works for me: {
"type": "node",
"request": "launch",
"name": "Run NPM script in WSL",
"useWSL": true,
"localRoot": "${workspaceFolder}",
"remoteRoot": "${command:extension.vscode-wsl-workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"foo",
],
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**/*.js",
],
}, To debug mocha tests, I use this launch configuration: {
"type": "node",
"request": "launch",
"name": "Run mocha tests in WSL",
"useWSL": true,
"localRoot": "${workspaceFolder}",
"remoteRoot": "${command:extension.vscode-wsl-workspaceFolder}",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"--exit",
"${command:extension.vscode-wsl-workspaceFolder}/tests/test.js"
],
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**/*.js",
],
}, Note: output will be in "Debug Console" tab. |
@n0v1 Worked for me. Thank you! This is a common use case now with developing on WSL and having debugging working for me is critical for my work. Now to get python working 🤞 |
We just announced remote development with VS Code, check out the blog post for details https://code.visualstudio.com/blogs/2019/05/02/remote-development |
I'm trying to debug a Node application using Windows Subsytem for Linux but I don't think the paths are translating.
This is my launch.json
and this is what appears in my console after attempting to debug:
And for further information
npm run-script start:dev
runsnodemon
and here is my nodemon.json:Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: