fix(server): allow install scripts in npm-global provider updates - #5646
Conversation
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
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: Approved 70e999f Straightforward bug fix for npm 12 compatibility. The change adds You can customize Macroscope's approvability policy. Learn more. |
## 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
Fixes #5627.
What changed
makeNpmGlobalProviderMaintenanceCapabilitiesnow adds--allow-scripts=<packageName>to the npm-global update args, scoped toexactly 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-scriptsallowlist shipsempty, 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 12it replaces a working global
claudewith a broken one and reports success. Thepackage's postinstall is what copies the platform-native binary over the
bin/claudestub. With the script blocked, the stub stays in place and everyclaudeinvocation fails withclaude native binary not installed. The fulldiagnosis and the npm debug log from the failing update are in #5627.
Compatibility
npm 11 ships
allow-scriptsas a known config key and accepts the flag, whichI 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
claudelaunches 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 duringnpm install -g …@latest.Without this, npm 12’s default empty script allowlist can block postinstall (e.g. copying the native
claudebinary) 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-scriptsflag to npm-global provider update commandsIn providerMaintenance.ts, the npm global update command now includes
--allow-scripts=<packageName>between-gand<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.