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

Use env.npm_config_* for electron and upcoming npm #30

Merged
merged 1 commit into from
Apr 25, 2020
Merged

Conversation

vweevers
Copy link
Member

I need this for electron-builder and the native addon ffi-napi, which recently started using node-gyp-build for prebuilds (node-ffi-napi/node-ffi-napi#63) but I want to compile it from source. With buildDependenciesFromSource: true you can instruct electron-builder to do so, but this currently does not work with node-gyp-build.

The problem is that the electron-builder tooling effectively calls npm rebuild <dep> and then npm_config_argv does not contain --build-from-source. However, env.npm_config_build_from_source does exist. Hooray!

Incidentally, using env.npm_config_* is also the recommended approach by npm and works since npm 0.1.8 while npm_config_argv will stop working in npm 7. See npm/rfcs#90.


Related: digidem/mapeo-desktop#305

@vweevers vweevers added the semver-patch Bug fixes that are backward compatible label Apr 23, 2020
@vweevers vweevers requested a review from mafintosh April 23, 2020 18:41
@vweevers vweevers merged commit cadbc9a into master Apr 25, 2020
@vweevers vweevers deleted the npm_config branch April 25, 2020 07:23
@vweevers
Copy link
Member Author

4.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch Bug fixes that are backward compatible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant