Skip to content

Avoid npm warnings by supporting MODULE_BINARY_MIRROR env variable#953

Open
yunnysunny wants to merge 1 commit intomapbox:masterfrom
yunnysunny:master
Open

Avoid npm warnings by supporting MODULE_BINARY_MIRROR env variable#953
yunnysunny wants to merge 1 commit intomapbox:masterfrom
yunnysunny:master

Conversation

@yunnysunny
Copy link
Copy Markdown

Description

With newer versions of npm (v10+), using environment variables in the form of:

npm_config_<module>_binary_host_mirror

will trigger warnings such as:

npm warn Unknown env config "<module>-binary-host-mirror"

This happens because npm now validates environment variables prefixed with npm_config_* against its known configuration keys, and custom keys used by tools like node-pre-gyp are no longer recognized.

Changes

To address this issue, this PR introduces support for an alternative environment variable:

<MODULE>_BINARY_MIRROR

Specifically:

The code now checks for npm_config_<module>_binary_host_mirror
Falls back to process.env.<MODULE>_BINARY_MIRROR

@yunnysunny yunnysunny requested a review from a team as a code owner April 7, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant