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

The npm_config_cache env var registry #1452

Closed
maxkononets opened this issue Feb 1, 2023 · 2 comments · Fixed by #1493
Closed

The npm_config_cache env var registry #1452

maxkononets opened this issue Feb 1, 2023 · 2 comments · Fixed by #1493

Comments

@maxkononets
Copy link

maxkononets commented Feb 1, 2023

VERSION
2.11.0

PROBLEM
install.js script uses only lowercase environment variable name:
npm_config_cache
npm_config_cache_folder
npm_config_yarn_offline_mirror

It becomes a problem when you add a Sentry installation script to an existing project which has such UPPER_CASE env.

PROPOSAL
Since NPM parses all NPM_CONFIG_* vars and does it case-insensitively install script should support both.

@maxkononets
Copy link
Author

My proposal do something similar to next:

function npmCache() {
  const env = process.env;
  return (
    env.npm_config_cache ||
    env.npm_config_cache_folder ||
    env.npm_config_yarn_offline_mirror ||
    (env.APPDATA ? path.join(env.APPDATA, 'npm-cache') : path.join(os.homedir(), '.npm'))
  );
}

transform to next:

function npmCache() {
  const env = process.env;
  return (
    env.npm_config_cache || env.NPM_CONFIG_CACHE ||
    env.npm_config_cache_folder || env.NPM_CONFIG_CACHE_FOLDER ||
    env.npm_config_yarn_offline_mirror || env.NPN_CONFIG_YARN_OFFLINE_MIRROR ||
    (env.APPDATA ? path.join(env.APPDATA, 'npm-cache') : path.join(os.homedir(), '.npm'))
  );
}

@github-actions
Copy link

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

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

Successfully merging a pull request may close this issue.

1 participant