Skip to content

[BUG] npm ignores node-gyp config setting #9826

Description

@bricss

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

This is not just a request to bump a dependency for a CVE

  • This is not solely a request to bump a dependency for a CVE

Current Behavior

Observed 🔭 on the npm v11 shipped ⚓ with Node.js:

After setting npm config set node-gyp <path> to globally 🌐 installed version of node-gyp on Windows npm continues to use built-in node-gyp no matter what.

Expected Behavior

After setting npm config set node-gyp <path> to the new path npm should pick up that path to run node-dyp during execution of npm install.

Steps To Reproduce

  1. Install node-gyp globally: npm install node-gyp -g
  2. Set node-gyp global path in npm config: npm config set node-gyp $(echo "${ npm ls -g node-gyp --parseable; }\bin\node-gyp.js")
  3. Run: npm install @confluentinc\kafka-javascript --foreground-scripts --loglevel=silly
  4. See error and observe that built-in node-gyp still in use:
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'clean'
gyp verb cli ]
gyp info using node-gyp@12.4.0
gyp info using node@26.5.1 | win32 | x64

Environment

  • npm: 11.17.0
  • Node.js: 26.5.1
  • OS Name: Windows 11
  • System Model Name: Microsoft Windows 11 Enterprise
  • npm config:
script-shell=C:\Program Files\Git\bin\bash.exe
node-gyp=C:\Users\<redacted>\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions