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-pre-gyp support in the same way than prebuild is supported #367

Closed
JCMais opened this issue May 10, 2020 · 5 comments · Fixed by #1095
Closed

node-pre-gyp support in the same way than prebuild is supported #367

JCMais opened this issue May 10, 2020 · 5 comments · Fixed by #1095
Labels

Comments

@JCMais
Copy link

JCMais commented May 10, 2020

@MarshallOfSound @malept pinging you folks as you are the most recent contributors, sorry to bother with this, but after looking for a similar solution I found this PR which was not accepted: #170.

node-pre-gyp does allow you to have prebuilt binaries for electron, just like prebuilt. For a working example, see the assets on this release: https://github.com/JCMais/node-libcurl/releases/tag/v2.1.2-1

The trick is that to make it use the correct prebuilt binary some arguments / environment variables must be passed with the npm install / yarn install command, like:

# npm
npm install node-libcurl --runtime=electron --target=v8.2.5 --disturl=https://www.electronjs.org/headers --save

# yarn
npm_config_runtime=electron npm_config_target=v8.2.5 npm_config_disturl=https://www.electronjs.org/headers yarn add node-libcurl

If those flags are not passed the prebuilt binary for the current Node.js version is going to be downloaded, and then later when electron-rebuild is called the addon is built from source, instead of trying to use the prebuilt binary for Electron.

Is the project willing to accept a PR that adds support to it? There is no need to bring the whole node-pre-gyp dependency itself as the linked PR did, as the process should be similar to the one used to support prebuild:
https://github.com/electron/electron-rebuild/blob/c42d6c7ed3ea07b6203a686ccdbfbae6bd5f8b5f/src/rebuild.ts#L295-L336

There are multiple related issues on this repo about node-pre-gyp support, the most recent one is this one:
#309

I should be able to dedicate some time to this PR, but I need to know if there is any possibility of it being accepted.

@liSong5713
Copy link

When publish this release for support node-pre-gyp?

@malept
Copy link
Member

malept commented Sep 14, 2021

There is no timeline. node-pre-gyp is complicated because there are multiple modules which implement it (the deprecated node-pre-gyp, the replacement @mapbox/node-pre-gyp, and any forks), which may or may not have different behavior.

@liSong5713
Copy link

liSong5713 commented Sep 14, 2021 via email

@gpetrov
Copy link

gpetrov commented Oct 3, 2022

the @mapbox/node-pre-gyp is the new official node-pre-gyp, so can we make it compatible with it? @malept

@continuous-auth
Copy link

🎉 This issue has been resolved in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

4 participants