Skip to content

fix(server): allow install scripts in npm-global provider updates - #5646

Merged
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
hey-jj:fix/npm-global-allow-scripts
Aug 15, 2026
Merged

fix(server): allow install scripts in npm-global provider updates#5646
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
hey-jj:fix/npm-global-allow-scripts

Conversation

@hey-jj

@hey-jj hey-jj commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #5627.

What changed

makeNpmGlobalProviderMaintenanceCapabilities now adds
--allow-scripts=<packageName> to the npm-global update args, scoped to
exactly the package being updated. A new test pins the exact argv for
@anthropic-ai/claude-code, and two existing expectations pick up the flag.
No other update path is touched.

Why

npm 12 blocks install scripts by default. The allow-scripts allowlist ships
empty, a blocked script produces only a warning, and the install exits 0. The
one-click provider update runs npm install -g <package>@latest, so on npm 12
it replaces a working global claude with a broken one and reports success. The
package's postinstall is what copies the platform-native binary over the
bin/claude stub. With the script blocked, the stub stays in place and every
claude invocation fails with claude native binary not installed. The full
diagnosis and the npm debug log from the failing update are in #5627.

Compatibility

npm 11 ships allow-scripts as a known config key and accepts the flag, which
I verified on 11.17.0. Older npm treats it as unknown config, warns, and
continues with exit 0.

Verification

On npm 12.0.2 the update completes with the postinstall run and claude
launches afterward. The touched test file passes.

The pnpm-global and bun-global paths may carry the same class of exposure, as
noted in #5627, but both managers already block install scripts by default, so
any breakage there is pre-existing rather than new with npm 12. This PR fixes
only the reproduced npm path.


Note

Low Risk
Narrow change to npm-global update argv only; older npm may warn on unknown config but continues, and script allowance is limited to the package being updated.

Overview
npm-global one-click provider updates now pass --allow-scripts=<packageName> so npm 12 can run that package’s install scripts during npm install -g …@latest.

Without this, npm 12’s default empty script allowlist can block postinstall (e.g. copying the native claude binary) while still exiting 0, leaving a broken global CLI after a “successful” update.

Tests were updated for advisory/update command strings and npm symlink resolution, and a new case pins argv for @anthropic-ai/claude-code. pnpm, bun, Homebrew, and native update paths are unchanged.

Reviewed by Cursor Bugbot for commit 70e999f. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add --allow-scripts flag to npm-global provider update commands

In providerMaintenance.ts, the npm global update command now includes --allow-scripts=<packageName> between -g and <package>@latest, scoping install script execution to only the package being updated. This works around npm 12's default behavior of blocking install scripts. Behavioral Change: packages updated via the npm-global provider will now have their own install scripts permitted to run, where previously they were blocked.

Macroscope summarized 70e999f.

npm 12 blocks install scripts by default and still exits 0, so the
one-click provider update replaced a working install with the
package's placeholder stub while reporting success. The npm-global
update args now carry --allow-scripts for exactly the package being
updated. npm 11 knows the key, older npm warns on unknown config and
continues.

Fixes pingdotgg#5627
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fe1c1562-2749-46e5-abc0-dbab3696a257

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 7, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 70e999f

Straightforward bug fix for npm 12 compatibility. The change adds --allow-scripts flag scoped to the specific package being installed, fixing silent failures in postinstall scripts while maintaining backwards compatibility. Well-documented with comprehensive test coverage.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge
juliusmarminge enabled auto-merge (squash) August 15, 2026 10:43
@juliusmarminge
juliusmarminge merged commit dc0ff8f into pingdotgg:main Aug 15, 2026
15 of 16 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 15, 2026
## What's Changed
* fix(desktop): route mouse thumb buttons to the in-app browser by @akosbalogh in pingdotgg/t3code#4459
* fix(web): keep the final segment of directory paths with a trailing separator by @jorvarea in pingdotgg/t3code#5460
* Keep block code plain when copying from rendered markdown by @yashranaway in pingdotgg/t3code#4468
* fix(web): add web app manifest so installed app keeps its scope by @Albro3459 in pingdotgg/t3code#4306
* Skip user hooks during Claude capability probes by @yashranaway in pingdotgg/t3code#4466
* fix(mobile): use Android monospace font family by @tastelessjolt in pingdotgg/t3code#4609
* fix(desktop): timestamps follow the OS locale instead of en-US by @brzzdev in pingdotgg/t3code#6190
* fix(web): keep multi-select questions open after the first click by @RaitP1 in pingdotgg/t3code#6646
* fix(web): stop clipping the changed-files expand hover on Windows by @mrmg in pingdotgg/t3code#6545
* fix(server): allow long-running git pushes by @devchaudhary24k in pingdotgg/t3code#6499
* fix(desktop): keep probing backend readiness while the process is alive by @lgwacker in pingdotgg/t3code#5526
* fix(server): allow install scripts in npm-global provider updates by @hey-jj in pingdotgg/t3code#5646
* fix: detect SSH remotes with non-git user prefixes (e.g. gitlab@) by @JackatDJL in pingdotgg/t3code#3649
* fix(web): describe what Ultracode does in the Reasoning picker by @delltrak in pingdotgg/t3code#6092
* fix(server): settle pending user-input requests when a Claude session stops by @AaronAbuUsama in pingdotgg/t3code#5127
* fix(server): stop replaying a command receipt for a different aggregate by @ostapondo in pingdotgg/t3code#5246
* fix(server): settle snoozed threads immediately by @0bkevin in pingdotgg/t3code#5379
* fix(mobile): prevent crash on sign out in settings by @shubhu121 in pingdotgg/t3code#4899
* fix(mobile): local-checkout threads record their branch so PR badges show by @Zeus-Deus in pingdotgg/t3code#4986
* fix(web): contain long approval commands by @Serendeep in pingdotgg/t3code#6503
* feat(web): make right panel maximize bindable by @husseinraoouf in pingdotgg/t3code#5091
* fix(server): respect inherited OPENCODE_CONFIG_CONTENT by @jonocodes in pingdotgg/t3code#4242
* fix(marketing): detect Mac chip on homepage download button by @mahdibm-dev in pingdotgg/t3code#4197
* Keep the server alive when a response write hits a dead socket by @yashranaway in pingdotgg/t3code#4470
* Limit physical key fallback to non-Latin layout output by @yashranaway in pingdotgg/t3code#4469
* fix: restore CLAUDE.md symlink target by @NgoQuocViet2001 in pingdotgg/t3code#3929
* fix(clients): default clone destination to folder plus repo name by @inayayousfi in pingdotgg/t3code#5989
* fix(web): keep timestamp date and time in the same locale by @juliusmarminge in pingdotgg/t3code#7081
* feat(desktop): add signal macOS DMG installer background by @Brechard in pingdotgg/t3code#6201

## New Contributors
* @akosbalogh made their first contribution in pingdotgg/t3code#4459
* @jorvarea made their first contribution in pingdotgg/t3code#5460
* @yashranaway made their first contribution in pingdotgg/t3code#4468
* @Albro3459 made their first contribution in pingdotgg/t3code#4306
* @tastelessjolt made their first contribution in pingdotgg/t3code#4609
* @brzzdev made their first contribution in pingdotgg/t3code#6190
* @RaitP1 made their first contribution in pingdotgg/t3code#6646
* @devchaudhary24k made their first contribution in pingdotgg/t3code#6499
* @lgwacker made their first contribution in pingdotgg/t3code#5526
* @JackatDJL made their first contribution in pingdotgg/t3code#3649
* @delltrak made their first contribution in pingdotgg/t3code#6092
* @AaronAbuUsama made their first contribution in pingdotgg/t3code#5127
* @0bkevin made their first contribution in pingdotgg/t3code#5379
* @shubhu121 made their first contribution in pingdotgg/t3code#4899
* @Zeus-Deus made their first contribution in pingdotgg/t3code#4986
* @husseinraoouf made their first contribution in pingdotgg/t3code#5091
* @jonocodes made their first contribution in pingdotgg/t3code#4242
* @mahdibm-dev made their first contribution in pingdotgg/t3code#4197
* @NgoQuocViet2001 made their first contribution in pingdotgg/t3code#3929
* @inayayousfi made their first contribution in pingdotgg/t3code#5989

**Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260815.1101...v0.0.34-nightly.20260815.1102

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260815.1102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Provider update leaves a broken claude install on npm 12 and reports success

2 participants