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

node-gyp-build ignores standardized env variables npm_config_target and npm_config_runtime #78

Open
IsaacAderogba opened this issue Sep 27, 2024 · 0 comments

Comments

@IsaacAderogba
Copy link

Hey guys, we’ve recently migrated to prebuildify and node-gyp-build to simplify our prebuilds process.

But we’re currently running into an issue where node-gyp-build isn’t acknowledging our environment usage of npm_config_target (for specifying electron version) and npm_config_runtime (for specifying runtime as electron) when installing native modules. This is causing our Electron prebuilds to not be found since it’s instead picking up on our outer node environment.

These environment variables seem to be standardized across [Electron](https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules#using-npm), but it looks like node-gyp-build is instead relying on process.versions.module and process.versions.electron to determine these instead. process.versions is marked as readonly so we can’t actually manipulate it to work for use case, so wanted to learn if I was missing something about how node-gyp-build supports environment configuration!

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