Debug nodeJS in WSL 1 broken
I have a very old project in node that is being rewritten in python...
But still back to my bug, if you try to run a debugger in pycharm 2022.4 - I get an error in the Process Console `internal/modules/cjs/loader.js:670
throw err;
`
in 2021.3.3 - everything works correctly, debug, breakpoints etc.
请先登录再写评论。
Node 11 + IDE path with spaces is the problem. Normally the IDE uses the NODE_OPTIONS environment variable to pass the debug flags to spawned node.js processes. But Node 11 doesn't support
NODE_OPTIONS
with quoted paths, so there is no way to handle paths with spaces inNODE_OPTIONS
.This was not the problem in 2022.1.3 because the debugConnector.js was copied to the TEMP dir and run from it (but, should the TEMP dir contain spaces or special chars, you would face the issue in 2022.1.3 as well)
I'd suggest to upgrade Node.js. Note that Node 11 is out of maintenance since 2019, see https://github.com/nodejs/Release#end-of-life-releases