-
Notifications
You must be signed in to change notification settings - Fork 29k
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
js-debug insists on recent version of node.js #111642
Comments
Node versions before 7 use the old inspector protocol rather than CDP, which we don't support, and the protocol is somewhat buggy even on 8. Node 8, which is EOL since this beginning of this year, accounts for <1.2% of debug users, and I imagine there are even fewer users with previous node versions, so I don't think it's worth going to the effort of trying to support this in any way aside from providing the informative prompt. |
@connor4312 I'm not asking for support for legacy versions of node.js here. The problem is that js-debug eagerly blocks my launch config based on the false assumption that it will use /usr/local/bin/node. But the launch config does not use node.js at all. So there is no reason for blocking it. I think the error should only be shown if js-debug detects a real problem where there is some probability that an old version of node.js might be the culprit. In my case I'm using a standard ubuntu (which seems to have node.js 5.0 installed). But since I'm using "nvm", I do not really care about the old node.js 5.0 install. Whenever I run node.js it picks up the correct "nvm-installed" version. Only js-debug seems to find the legacy version. |
js-debug does not know that the launch won't eventually use Node.js; we support debugging nested processes in the tree. In theory we could allowlist certain commands that don't have side effects like "echo" or "cat", but I don't know why users would want to have a node launch config that doesn't use Node... On 6 and below we get a syntax error trying to import the bootloader. If the process is not running in an integrated or external terminal, we could catch the syntax error from stderr, but in a terminal we would have no way to know what happened and be stuck waiting for the connection.
We pull |
One thing I thought of is checking process.version in the bootloader and just echo'ing the warning to the console if the version is too low. However this has two downsides:
|
@connor4312 thanks a lot for exploring this... But again, I'm actually not asking for supporting node.js 5.x (or other obsolete versions). Imagine I have shell script that uses a version 12.13.1 of node.js and hardcodes an absolute path to it. If I now create a debug config that uses the shell script from above as the "runtimeExecutable", js-debug will prevent me from debugging this perfectly fine setup because it finds the obsolete version of node. |
@connor4312 perfect, thanks a lot! |
Testing #111422
This launch config (which doesn't use node.js at all):
does not work on a linux that only has node.js 5.0.
Error message:
The launch config works fine when setting
debug.javascript.usePreview
to false.(I use "nvm" on that linux and have it configured for node.js "12.13.1" but js-debug doesn't find it on the PATH, but that is a different issue...)
The text was updated successfully, but these errors were encountered: