Skip to content

test: use npm_config_extra_param for npm custom install test (npm 12) - #1132

Open
MikeMcC399 wants to merge 1 commit into
nodejs:mainfrom
MikeMcC399:fix/npm-install-custom
Open

test: use npm_config_extra_param for npm custom install test (npm 12)#1132
MikeMcC399 wants to merge 1 commit into
nodejs:mainfrom
MikeMcC399:fix/npm-install-custom

Conversation

@MikeMcC399

Copy link
Copy Markdown
Contributor

Situation

npx tap test/npm/test-npm-install.js fails under npm 12. It uses an undefined placeholder CLI option --extra-param in an npm install command.

npm@12.0.0 throws an error for unknown CLI flags.

The npm package omg-i-pass-with-install-param looks for the environment variable npm_config_extra_param in order to execute its install script successfully.

Change

Replace the parameter --extra-param with the environment variable npm_config_extra_param instead of passing it using the CLI. See https://docs.npmjs.com/cli/v12/using-npm/config#environment-variables

Verification

Test in CI actions/workflows/nodejs.yml for compatibility with npm 10 & 11.

Test locally using Node.js 26.7.0 / npm 12.0.2:

npx tap test/npm/test-npm-install.js
Checklist
  • npm test passes
  • contribution guidelines followed
    here

changed for npm 12 compatibility
which otherwise throws an error for unknown cli flags

Signed-off-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
@codecov-commenter

codecov-commenter commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.11%. Comparing base (eef880d) to head (37155c7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1132      +/-   ##
==========================================
- Coverage   96.20%   96.11%   -0.10%     
==========================================
  Files          29       29              
  Lines        2213     2213              
==========================================
- Hits         2129     2127       -2     
- Misses         84       86       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MikeMcC399
MikeMcC399 marked this pull request as ready for review August 22, 2026 15:31
@MikeMcC399 MikeMcC399 changed the title test: use npm_config_extra_param for npm custom install test test: use npm_config_extra_param for npm custom install test (npm 12) Aug 22, 2026
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.

2 participants