Skip to content

fix: Let npm 12 read bundled deps in Renovate locks - #40

Closed
ecv wants to merge 1 commit into
mainfrom
fix/renovate-npm12-bundled-tarballs
Closed

ecv wants to merge 1 commit into
mainfrom
fix/renovate-npm12-bundled-tarballs

Conversation

@ecv

@ecv ecv commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Security and dependency updates can't merge in any repository that uses Tailwind 4. Renovate fails to rebuild package-lock.json, pushes the pull request with the old lockfile, and CI then fails npm ci because package.json and package-lock.json are out of sync. After this change, Renovate rebuilds those lockfiles and the pull requests below can pass CI once Renovate rebases them.

Stuck pull requests:

Cause

Renovate runs npm 12, because none of these repositories pins an npm version. npm 12 defaults to allow-remote=none. A normal registry install is exempt from that setting. But with --package-lock-only, npm unpacks every package that declares bundleDependencies so it can read what the bundle contains, and that fetch skips the exemption. Tailwind 4's optional @tailwindcss/oxide-wasm32-wasi is one of those packages, so npm refuses its own registry tarball:

npm error code EALLOWREMOTE
npm error Refusing to fetch "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.3.tgz"

This is npm's bug, still open upstream: npm/cli#9800. The existing replace-registry-host=always setting fixed a different case, where the tarball's host doesn't match the registry. It doesn't help here, because the host already matches.

Change

The preset adds allow-remote=all to the .npmrc that Renovate writes for its lockfile step.

Warning

This relaxes one npm 12 safeguard, but only inside Renovate's lockfile step. That step runs with --ignore-scripts. Each repository's own .npmrc and its CI keep npm 12's default allow-remote=none. So a lockfile that resolves a dependency to a URL still fails npm ci in CI. allow-remote=root is not enough, because the refused package is a transitive dependency. Remove the line once npm/cli#9800 is fixed.

Not covered

app#236 also fails on ui/packaging/dmg/package-lock.json with EBADPLATFORM (appdmg supports only macOS, and Renovate runs on Linux). This preset can't fix that. It needs a change in that repository, for example os=darwin in ui/packaging/dmg/.npmrc.

Test plan

  • Reproduced the failure on a staff-portal clone with npm 12.2.2: npm install --package-lock-only --ignore-scripts --replace-registry-host=always @hono/node-server@2.1.6 exits 1 with the EALLOWREMOTE error above
  • The same command with --allow-remote=all succeeds. The lockfile moves @hono/node-server to 2.1.6, and every resolved URL stays on registry.npmjs.org
  • npm ci --ignore-scripts under npm 12.2.2 defaults (allow-remote=none) succeeds on the regenerated lockfile
  • bin/validate-renovate-config passes
  • After merge, Renovate rebases the stuck pull requests above and their lockfile CI passes

Renovate's lockfile step fails with EALLOWREMOTE in every repository on
Tailwind 4, so its pull requests carry a stale package-lock.json and fail
npm ci. With --package-lock-only, npm 12 unpacks each package that declares
bundleDependencies to read the bundle, and that fetch skips the
registry-tarball exemption from the default allow-remote=none
(npm/cli#9800). Tailwind's optional @tailwindcss/oxide-wasm32-wasi is such
a package, served from registry.npmjs.org.

Set allow-remote=all in the .npmrc Renovate writes for its own lockfile
step. Repositories keep their own .npmrc, so npm ci in CI keeps npm 12's
default refusal and still rejects a lockfile that resolves to a URL.
@ecv
ecv marked this pull request as ready for review November 17, 2026 19:53
@ecv
ecv requested review from a team, kevwilliams and scotwells November 17, 2026 19:53
@ecv
ecv marked this pull request as draft November 17, 2026 20:36
@ecv

ecv commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of per-repo npm constraints in the affected repos, which keep npm's remote-download guard on everywhere. See the security review findings.

@ecv ecv closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant