-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
nyc@15 crashes when spawning a different Node.js version #1246
Comments
Use `NODE_PATH` and use bare filename for `--require` if it is needed in node.js < 12 or if node.js 12+ would otherwise require quoting the require path. This should avoid a crash when `node-preload` is setup in node.js 12 but then a test is run under node.js < 12. It should also ensure compatibility when setup is performed in node.js < 12 and tests are later run under node.js 12+. Ref istanbuljs/nyc#1246
Use `NODE_PATH` and use bare filename for `--require` if it is needed in node.js < 12 or if node.js 12+ would otherwise require quoting the require path. This should avoid a crash when `node-preload` is setup in node.js 12 but then a test is run under node.js < 12. It should also ensure compatibility when setup is performed in node.js < 12 and tests are later run under node.js 12+. Ref istanbuljs/nyc#1246
Thanks for this report. I've posted a PR to |
I just tried it and it works! Thanks a lot Corey 👍 |
Thanks for the update. Be aware the branch I linked will be going away shortly and node-preload@0.2.1 will be released. nyc uses |
Use `NODE_PATH` and use bare filename for `--require` if it is needed in node.js < 12 or if node.js 12+ would otherwise require quoting the require path. This should avoid a crash when `node-preload` is setup in node.js 12 but then a test is run under node.js < 12. It should also ensure compatibility when setup is performed in node.js < 12 and tests are later run under node.js 12+. Ref istanbuljs/nyc#1246
node-preload@0.2.1 is now published, I verified it gets pulled in by |
Thanks a lot Corey! |
I'm hoping dropping |
For what is worth the current tests don't pass on native Windows cmd. Travis is using msys2 or something. I'm unsure if this affects nyc Windows users though, I just noticed it while trying to do |
@XhmikosR would you mind opening a new issue including a link to a repo and any special instructions for how to reproduce the issue? |
Link to bug demonstration repository
https://github.com/ehmicky/nyc-bug-repro
Expected Behavior
nyc
should not crash when spawning a different Node.js version than the current one.This happens for example when using nvm or similar tools.
Observed Behavior
nyc
crashes.Troubleshooting steps
index.js
:Notes
Please note the following bug only happens when:
>= 12
< 12
Also this only happens with
nyc@15
. I cannot use--use-spawn-wrap=true
becausespawn-wrap
has its own sets of bugs thatnode-preload
fixes.The
index.js
file is spawning a node binary directly via its absolute path. This is only to make it easy to reproduce. In real life, this would be done when thePATH
environment variable points to a different Node.js version, which happens when usingnvm run
and other tools.Environment Information
The text was updated successfully, but these errors were encountered: