question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set platform npm environment variable

See original GitHub issue
  • Version: 10.8.1
  • Target: all

prebuild now fully supports Electron and works great together with electron-builder and the npmSkipBuildFromSource option.

Additionally it would be great if electron-builder could expose the platform it builds for to a npm environment variable (npm_config_platform) during the rebuilding of native modules.

This way prebuild would be able to download the correct prebuilt binary for the desired target. This would make multi platform builds with native dependencies possible.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
develarcommented, Dec 19, 2016

Will be implemented soon.

1reaction
mmckeggcommented, Dec 19, 2016

@lgeiger I actually added support for this on my own branch but never PR’d it because it was a bit hacky.

https://github.com/mmckegg/electron-builder/commit/e0936afe3701f6507a2856ea7ee4421e5c0a2af9

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set environment variables in a cross-platform way?
Is there a way to declare environment variables in a way that is consistent and cross-platform? javascript · node.js · npm · Share....
Read more >
config | npm Docs
Any environment variables that start with npm_config_ will be interpreted as a configuration parameter. For example, putting npm_config_foo=bar in your ...
Read more >
Working with Environment Variables in Node.js - Twilio
Environment variables are a great way to configure parts of your Node.js application. Learn how to work with them using helpful tools such ......
Read more >
Setting up environment variables in Node.js ... - GeeksforGeeks
Setting up environment variables in Node.js in a platform independent way · Step 1: Install · Step 2: · Step 3: Require dotenv...
Read more >
Environment variables - cross-platform-node-guide - GitHub
Outside Node.js (e.g. in npm scripts), environment variables should be referenced and passed using cross-env . Use os methods ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found