Skip to content

fix: do not forward allow-scripts to git preparation - #512

Open
carrerasdarren-cell wants to merge 1 commit into
npm:mainfrom
carrerasdarren-cell:fix-git-prepare-allow-scripts-env
Open

fix: do not forward allow-scripts to git preparation#512
carrerasdarren-cell wants to merge 1 commit into
npm:mainfrom
carrerasdarren-cell:fix-git-prepare-allow-scripts-env

Conversation

@carrerasdarren-cell

Copy link
Copy Markdown

Summary

  • remove npm_config_allow_scripts from the environment of the nested install used to prepare git dependencies
  • preserve the user-config path so the nested npm process reloads the policy from .npmrc at the correct config layer
  • cover lowercase and uppercase environment keys while verifying unrelated environment and cycle-prevention state are preserved

Fixes npm/cli#9783.

Testing

  • npm test -- --no-coverage
  • npx eslint lib/git.js test/git.js test/fixtures/npm-mock.js
  • exact offline git-dependency reproduction with npm 12.0.1: stock path fails with EALLOWSCRIPTS; patched Pacote extracts successfully

AI Disclosure

This change was written with the assistance of Codex. I reviewed the diff and tests and take responsibility for the code.

@carrerasdarren-cell
carrerasdarren-cell requested a review from a team as a code owner July 22, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants