Repository navigation
fix: pin cross-spawn 7.0.6, whose 7.1.0 breaks npm on Windows - #6660
Merged
Merged
Conversation
janicduplessis
marked this pull request as ready for review
November 28, 2026 23:59
janicduplessis
enabled auto-merge (squash)
November 28, 2026 23:59
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.
Description
cross-spawn 7.1.0 (published 2026-11-28 18:50Z) breaks spawning a batch shim by its bare name on Windows.
spawn('npm', ['-v'])fails withCannot find module '<cwd>\node_modules\npm\bin\npm-prefix.js'. Since moxystudio/node-cross-spawn#191,lib/parse.jsquotes the command as given ("npm") on thecmd.exeline, and cmd.exe expands%~dp0to the current directory when a batch file runs from a quoted bare name. npm'snpm.cmdbuilds its paths from%~dp0.Two things hit it (#6659):
npx @react-native-community/cli@latest initinstalls the newest cross-spawn under execa, so the bare fixture'snpm init -yfails andandroid bare (loop, windows)can't create its app. Runs 46193153813 and its rerun fail this way. The nightly from before the release passed.stimand@stim-cli/cideclarecross-spawn: ^7.0.6, so a fresh install resolves 7.1.0. EveryrunFile('npm', ...)goes through it.exec.ts:552-554also relies on 7.0.6's^%escaping, which 7.1.0 replaced. Our lockfile still has 7.0.6, which is why CI didn't notice.Solution
cross-spawnto exactly7.0.6in both packages. The lockfile already resolves 7.0.6, so only the specifiers change.npx --package @react-native-community/cli@latest --package cross-spawn@7.0.6 -- rnc-cli init .... npx hoists the requested 7.0.6, which satisfies execa's^7.0.3.I haven't reported it upstream; that needs a maintainer's go-ahead.
Test plan
windows-debug.ymlrunner (Node 22.23.5, npm 10.9.9):require('cross-spawn').sync('npm', ['-v'])fails with the error above under 7.1.0, and prints10.9.9under 7.0.6.suite=loopontmp/6633-e2e-with-6659(this commit on top of fix: a warmed npm worktree's Windows build is cached again #6655): the Windows bare fixture is created again, andandroid bare (loop, windows)passes, job 141156135471.Fixes #6659