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.

default values for environment variables

See original GitHub issue

Hi,

Is there a way to default a variable in binding.gyp yet allow a different user externally set a different value.

https://github.com/HDF-NI/hdf5.node/blob/master/binding.gyp#L3 Some people have a hard coded path to native dependencies while others like a more app packaged deployment and/or the ability to have more than one version installed

"hdf5_home_linux": "/usr/local"

How to keep a default yet make it adaptable for other choices?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
bnoordhuiscommented, Apr 28, 2016

For anyone coming here through a search engine, you can alternatively pass options through the GYP_DEFINES environment variable:

$ env GYP_DEFINES="name=value name2=value" npm install

That should work with any node-gyp version.

0reactions
m4heshdcommented, Nov 20, 2021

$ env GYP_DEFINES="name=value name2=value" npm install

Anybody know where’s the documentation for this? 🙄

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Are the Default Environment Variables in Windows?
What are the default environment variables in Windows? · %ALLUSERSPROFILE% · %APPDATA% · %CommonProgramFiles% · %CommonProgramFiles(x86)% · % ...
Read more >
Windows 10 default environment variables | Richard Buz
Windows 10 default environment variables ; %LOGONSERVER%, \\{domain_logon_server} \\MicrosoftAccount ; %NUMBER_OF_PROCESSORS%, 8 ; %OS%, Windows_NT ; %PATH%. C:\ ...
Read more >
Assigning default values to shell variables with a single ...
To get the assigned value, or default if it's missing: FOO="${VARIABLE:-default}" # If variable not set or null, use default. # If VARIABLE...
Read more >
Solved: Environment Variables: Default Value vs. Current V...
I understand why both ways work, as Environment Variables are only "data" in 2 tables after all. 1) Default Value = PROD: We...
Read more >
Default environment variables - Release - ReleaseHub
Environment variables consist of a key, a value, and an optional secret flag. Mark an environment variable as secret using secret=true . Secrets...
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