Skip to content

Conversation

@IsaacAderogba
Copy link

This PR addresses a similar problem that was acknowledged by #46 a few years ago, and which I raised a few months back, #78.

The issue is that node-gyp-build doesn't acknowledge the use of standardized npm_config_* variables, and instead relies on values like process.versions.module and process.versions.electron which are not easily configurable as they are read-only.

This PR does two things:

  • Allows the runtime to be set to "electron" if process.env.npm_config_runtime is equal to "electron".
  • Computes the correct abi if an explicit process.env.npm_config_target is defined ("electron", "node", and "node-webkit" are already valid values that can be passed to nodeAbi.getAbi to determine the abi).

I'm not sure if there are design reasons you have to keep things the way they are, but please let me know. Also happy to adjust the PR if you'd prefer to have this issue solved in a different way. process.versions.node is still preferred over process.env.npm_config_target, for example, as I wanted to limit the scope to address my earlier Github issue.

Thank you!

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

Successfully merging this pull request may close these issues.

1 participant