fix(installer): support npm 12 remote dependency policy - #1992
Merged
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1d25a60. Configure here.
snimu
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Summary
--allow-remote=allonly to the checksum-verified installer command under npm 12 or newerSecurity
npm 12's narrower
allow-remote=rootpolicy still rejects the current release graph because the R2 tarballs are non-root dependencies. The installer therefore usesall, but only for its controlled global install command after verifying the downloaded root tarball againstSHA256SUMS. It does not change user or global npm configuration.No-Ticket: The immediate report is public Discussion #1988, not a Research ticket.
This is a compatibility fix for the current R2 release format. ENG-4686 tracks the longer-term move away from R2 URL dependencies.
Validation
npm run check:installernpm run checkNPM_CONFIG_IGNORE_SCRIPTS=true, and a temporary global prefixReported in Discussion #1988.
Note
Fix
install.shto add remote dependency policy flags for npm 12+prime_agent_npm_requires_remote_policyto parse the active npm version and return success only for major version 12 or newerprime_agent_npm_installwrapper that preserves existing quiet/audit/funding options and, for npm 12+, permits remote dependencies and tarball-specific lifecycle scripts; older npm versions use the prior argument setinstall_prime_agent_packagenow call this wrapper instead of invokingnpm installdirectlyscripts/check-installer-render.mjstoscripts/check-installer.mjs, adds acheckNpmInstallPoliciestest that verifies no overrides for npm 10/11 and correct overrides for npm 12, and updates thecheck:installerscript accordinglyprime_agent_npm_installpasses--allow-scriptsscoped to the verified tarball for npm 12+; if npm changes flag behavior or the tarball name does not match, global install may fail or scripts may not runMacroscope summarized 3498b0e.
Note
Medium Risk
The installer widens npm 12 remote/script allowances for a single verified global install command; scope is limited but touches release install security policy.
Overview
Fixes stable installs failing on npm 12 when the verified release graph pulls non-root R2 tarball dependencies.
install.shnow routes global installs throughprime_agent_npm_install, which detects npm major ≥ 12 and adds--allow-remote=allplus--allow-scriptsscoped to the checksum-verified root tarball; npm 10/11 keep the previousnpm install -gflags.CI and local checks were extended: the release workflow smoke-tests a packed stable release served locally under npm 12.0.2, and
check-installer.mjsasserts install flag behavior for simulated npm 10.9.8, 11.12.1, and 12.0.2 (thecheck:installerscript entry was updated accordingly). A coding-agent changelog fragment documents the fix for Discussion #1988.Reviewed by Cursor Bugbot for commit 3498b0e. Bugbot is set up for automated code reviews on this repo. Configure here.