Skip to content
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

Infer nodedir for headerfiles from execPath #3033

Open
johnpyp opened this issue May 15, 2024 · 0 comments
Open

Infer nodedir for headerfiles from execPath #3033

johnpyp opened this issue May 15, 2024 · 0 comments

Comments

@johnpyp
Copy link

johnpyp commented May 15, 2024

  • Node Version: latest 18 / 20
  • Platform: Linux arm64/x86_64
  • Compiler: gcc
  • Module: anything

(Didn't follow for the format as this is a general capability request, for any version)


Following from #812 and reading through some of the code in lib/configure.js and https://github.com/nodejs/node-gyp/blob/main/lib/find-node-directory.js, could the general strategy of inferring the nodedir through a traversal from process.execPath work to automatically find headers files even when using non-standard installation locations of node?

In other words, infer the npm_config_nodedir from the execPath, instead of requiring users set it explicitly:

export npm_config_nodedir="/my/node/install/path/18.x.x/"

node-gyp ...

My main hesitation is I don't know if this could accidentally end up with false-positive identification in a lot of the cases for some reason, or otherwise break some ecosystem usage. It could also be behind a flag or variable like --infer-nodedir / npm_config_infer_nodedir if that's a concern, though of course preferably it could be a default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant