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

Building native modules for third-party native dependencies #4174

Closed
tHBp opened this issue Aug 21, 2019 · 3 comments
Closed

Building native modules for third-party native dependencies #4174

tHBp opened this issue Aug 21, 2019 · 3 comments
Labels

Comments

@tHBp
Copy link

tHBp commented Aug 21, 2019

  • Version: 21.2.0
  • Target: darwin
  • Node Version: 12.6.0
  • npm Version: 6.9.0
  • Electron Version: 6.0.3
  • node -p process.versions.modules: 72
  • Electron modules version: 73

I'm using node-sass and getting version mismatch issue. This issue, although strikingly similar to #453 and #683, is a bit different in the sense that I'm trying to consume a dependency which uses native modules.

Now, building node-sass and manually copying binaries works, as mentioned here but it is a hacky solution.

For this effect, I tried to use nodeGypRebuild, but setting nodeGypRebuild to true tries to use current working directory as source for binding.gyp which in this case should be ./node_modules/node-sass/ (because of resolution of issue #683 here). This means that nodeGypRebuild is meant for rebuilding native modules that I'm using.

So, I tried using npmRebuild in tandem with npmArgs. But, npm unfortunately doesn't pass arguments to npm rebuild to desired postinstall script (corresponding issue here).
But even if this issue is fixed, npmArgs would be passed to all the native modules, which may not be ideal in all the scenarios (although, that would work in my case).

So, can we have a configuration, possibly per dependency, to pass extra arguments to only specified native modules? Maybe something like this?

{
    "npmRebuild": {
        "node-sass": ["--arg1", "--arg2"]
    }
}
@stale
Copy link

stale bot commented Oct 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added backlog and removed backlog labels Oct 21, 2019
@tHBp
Copy link
Author

tHBp commented Oct 21, 2019

@develar Any inputs on this? I'd be happy to submit a PR after we iron out the wrinkles.

@stale
Copy link

stale bot commented Dec 20, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Dec 20, 2019
@stale stale bot closed this as completed Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant