microsoft / microsoft/vscode-js-debug

Support nodenv in the nvm resolver or binary provider

Open
#763 4 comments 0 reactions 1 assignee View on GitHub

@connor4312 is already working on this.

Since Sep 17, 2020.

feature-request help welcome
Dominant language
TypeScript
Stars
2k
Forks
373
Avg merge
1d 9m
Merged PRs (30d)
6

Description

Describe the bug
I can no longer debug apps that don't use at least node12, when using nodenv

To Reproduce
Steps to reproduce the behavior:

  1. Install nodenv
  2. Make your default node version >= 12.x
  3. Make an app that uses a .node-version file to use 10.x for it
  4. Make a launch config to debug this app
  5. Try to debug it. It fails because it's trying to use the node 12.x --inspect-publish-uid flag with node 10

VS Code Version: 1.49.0

Additional context
The problem seems to be that the feature enabled in
https://github.com/microsoft/vscode-js-debug/commit/32244ec6b0c979f79a1808cbb506e6ef5900d6b2
relies on resolveAndValidate here
https://github.com/microsoft/vscode-js-debug/blob/2518eeb26140ef2d3c0254056614bf335b7a29d3/src/targets/node/nodeBinaryProvider.ts#L128
And that code doesn't understand that the node binary in use may depend on the working directory, not just PATH from the environment.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.