firsttris / vscode-jest-runner

Simple way to run or debug one or more tests from context menu, codelens or command plalette
https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner
MIT License
265 stars 124 forks source link

Debug not finding node #344

Closed brahn closed 8 months ago

brahn commented 8 months ago

(This might be the same problem as #303, I'm not sure)

I am using this extension in VSCode for mac, and have specified my node using nvm. I can use the "run" command exposed by codelens, but when I try to use the debug command I encounter the following error:

Can't find Node.js binary "node": path does not exist. Make sure Node.js is installed and in your PATH, or set the "runtimeExecutable" in your launch.json

It would be desirable for the extension to more directly find the node executable for the debugger to use.

Workaround

I managed to solve this problem by updating the debug.javascript.defaultRuntimeExecutable setting in settings.json. Previously it was set to {"pwa-node": node}, and I modified it to

{
  "debug.javascript.defaultRuntimeExecutable": {
    "pwa-node":  "/full/path/to/node-binary"
  }
}

Happy to include more config information if that's helpful.

cdaringe commented 8 months ago

It’s not the answer you’re looking for unfortunately, but ultimately, this is a VS code issue, not an issue with this extension.

The VS code team would probably suggest it’s a user issue as well… But a case could be made to at least improve the UX around the failure to them.

Your issue is certainly related to the referenced issue. TLDR if you launch your editor in such a fashion that the editor doesn’t see node on PATH, nothing that launches child processes dependent on node are going to work.

cdaringe commented 8 months ago

cd project && nmv use && code .

and ur good to go

brahn commented 8 months ago

@cdaringe thanks and much appreciated!

firsttris commented 8 months ago

@cdaringe please accept collaborator invitation. i think someone removed you by accident.

cdaringe commented 8 months ago

https://github.com/firsttris/vscode-jest-runner/issues/344#issuecomment-1839478655

courtesly closing as wont do. if you feel otherwise, please take it up with vscode and feel free to cross ref this issue