daveleroy / SublimeDebugger

Graphical Debugger for Sublime Text for debuggers that support the debug adapter protocol
MIT License
374 stars 44 forks source link

runtimeExecutable support for node #274

Closed carlpett closed 3 weeks ago

carlpett commented 3 weeks ago

I'm trying to get the node debugger to work when having the node binary not on PATH, but installed project-local (we use nvm to set per-project versions). In the repo vscode-node-debug2 which is linked for docs (which is archived?), this is achieved by setting runtimeExecutable to the installed path. However, this does not seem to get picked up? I still get an error about not finding node in PATH.

Here's the debugger section of my project:

    "debugger_configurations":
    [
        {
            "runtimeExecutable": "${workspaceFolder}/node_modules/.nvm/node",
            "envFile": ".env-debug",
            "name": "my-project",
            "request": "launch",
            "type": "node",
        }
    ],

When attempting to start the debugger, this is logged:

Unable to stop: Debugging not started
This adapter requires node it looks like you may not have node installed or it is not on your path: [Errno 2] No such file or directory: 'node'. 
https://nodejs.org/

What am I doing wrong?

carlpett commented 3 weeks ago

I've temporarily gotten things to work in the specific project I'm working on right now by hardcoding the node global setting.

daveleroy commented 3 weeks ago

runtimeExecutable is what the vscode-js-debug adapter is going to use when launching your target.

The global node setting is what this package is going to use to run the vscode-js-debug adapter and generally shouldn't be set because you would have node on your path.