GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(config): avoid exporting persistent allow-scripts by Fnine59 · Pull Request #9913 · npm/cli

Conversation

@Fnine59

@Fnine59 Fnine59 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What / Why

A user or global .npmrc can define allow-scripts as persistent policy. setEnvs() currently carries that non-default value into lifecycle child processes as npm_config_allow_scripts. If a lifecycle script runs a nested project-scoped npm install, the inner process treats the inherited value as an environment override and rejects it with EALLOWSCRIPTS instead of reloading the policy from its persistent config source.

Mark allow-scripts as non-exportable. This only prevents setEnvs() from synthesizing the lifecycle environment variable; it does not remove an explicitly supplied environment value or change how the outer command reads its config. Pacote's git-preparation environment filtering and #9783 are outside this change.

The regression test models a user-level value in the inherited config chain and verifies that lifecycle scripts do not receive npm_config_allow_scripts.

AI assistance

OpenAI Codex assisted with analysis, implementation, and test design. The patch was verified with the focused regression, the complete @npmcli/config suite, lint, and template checks.

References

Fixes #9912

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Fnine59
fix(config): avoid exporting persistent allow-scripts
473d216
@Fnine59
Fnine59 requested review from a team as code owners August 24, 2026 01:33
@Fnine59 Fnine59 mentioned this pull request Aug 24, 2026
[BUG] A user/local .npmrc allow-scripts setting is forwarded to an inner npm install spawned by npm run-script and fails with EALLOWSCRIPTS #9912
Closed
Fnine59 added 2 commits August 26, 2026 13:22
@Fnine59
Merge upstream/latest into fix/npm-allow-scripts-env-9912
8c23b3e
@Fnine59
Merge upstream/latest into fix/npm-allow-scripts-env-9912
843d75c
martinrrm
martinrrm reviewed Aug 27, 2026
View reviewed changes
Comment thread workspaces/config/test/set-envs.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread workspaces/config/test/set-envs.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread workspaces/config/lib/definitions/definitions.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@martinrrm martinrrm self-assigned this Aug 27, 2026
Fnine59 added 2 commits August 28, 2026 02:12
@Fnine59
chore(config): add allow-scripts policy coverage
3a3a553
@Fnine59
chore(config): update docs snapshot
c06d865
martinrrm
martinrrm approved these changes Aug 31, 2026
View reviewed changes
@martinrrm martinrrm added the backport:v11 label Aug 31, 2026
@martinrrm
martinrrm merged commit b016aa2 into npm:latest Aug 31, 2026
47 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Aug 31, 2026
fix(config): avoid exporting persistent allow-scripts #9937
Merged
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🎉 Backport to release/v11 created: #9937

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Aug 26, 2026
chore: release 12.1.0 #9839
Merged
martinrrm pushed a commit that referenced this pull request Sep 2, 2026
@github-actions @Fnine59
fix(config): avoid exporting persistent allow-scripts (#9937)
64d4b4b
Backport of #9913 to `release/v11`.

Co-authored-by: Fnine59 <[email protected]>
@techaboo techaboo mentioned this pull request Sep 14, 2026
[BUG] npm exec / npx forwards persistent user-level allow-scripts to children as npm_config_allow_scripts, failing project-scoped installs in the child (EALLOWSCRIPTS) #9968
Open
@npm-cli-bot npm-cli-bot mentioned this pull request Sep 22, 2026
deps: upgrade npm to 12.1.0 nodejs/node#66212
Merged
@qodo-code-review qodo-code-review Bot mentioned this pull request Oct 29, 2026
fix(pnpm): resolve the native binary download against the configured registry garnet-labs/pnpm#124
Open
This was referenced Nov 24, 2026
[BUG] A user/global .npmrc allow-scripts setting is forwarded to git-dependency preparation as an env-layer policy and fails the install with EALLOWSCRIPTS #9783
Closed
fix: do not forward allow-scripts to git preparation npm/pacote#512
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@martinrrm martinrrm martinrrm approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@martinrrm martinrrm

Labels

backport:v11

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG] A user/local .npmrc allow-scripts setting is forwarded to an inner npm install spawned by npm run-script and fails with EALLOWSCRIPTS

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Fnine59 @martinrrm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.