Repository navigation
Open
Description
Issue
Running npx patch-package ... under npm 12 will now produce the following error:
npx patch-package nx
npm notice run npx
npm notice run 'patch-package' nx
patch-package 8.0.1
• Creating temporary folder
• Installing nx@22.7.5 with npm
{
status: 1,
signal: null,
output: [ null, null, null ],
pid: 81284,
stdout: null,
stderr: null,
error: null
}
/Users/xyz/node_modules/patch-package/dist/makePatch.js:395
throw e;
^
{
status: 1,
signal: null,
output: [ null, null, null ],
pid: 81284,
stdout: null,
stderr: null,
error: null
}
Node.js v24.18.0Explanation
Changing stdio to inherit here:
patch-package/src/makePatch.ts
Lines 239 to 246 in be4dfd7
| } catch (e) { | |
| // try again while ignoring scripts in case the script depends on | |
| // an implicit context which we haven't reproduced | |
| spawnSafeSync(`npm`, ["i", "--ignore-scripts", "--force"], { | |
| cwd: tmpRepoNpmRoot, | |
| stdio: "ignore", | |
| }) | |
| } |
will now gives better hint on the issue:
• Installing nx@22.7.5 with npm
npm warn using --force Recommended protections disabled.
npm error code EALLOWREMOTE
npm error Fetching packages of type "remote" have been disabled
npm error Refusing to fetch "nx@https://registry.npmjs.org/nx/-/nx-22.7.5.tgz"
npm error A complete log of this run can be found in: /Users/xyz/.npm/_logs/2026-08-02T00_31_48_537Z-debug-0.logNpm 12 now set allow-remote=none by default, which blocks any background installations trying to download direct tarballs (.tgz files) from an absolute remote URL, even if it points to the official registry.
Temporary solution
Use the following:
npm_config_allow_remote=all npx patch-package ...Fix
Add the argument --allow-remote=all to both npm commands:
patch-package/src/makePatch.ts
Line 234 in be4dfd7
spawnSafeSync(`npm`, ["i", "--force"], { patch-package/src/makePatch.ts
Line 242 in be4dfd7
spawnSafeSync(`npm`, ["i", "--ignore-scripts", "--force"], {
Reacted by Ricardo, vismiktor, doff6, Ryan Fitzgerald and Christian Koop
Metadata
Metadata
Assignees
Labels
No labels
Activity
manzoorwanijk commentedon Sep 20, 2026
I added native patching in npm v12. You no longer need a third-party solution on v12.
femto-code commentedon Nov 7, 2026
@manzoorwanijk Many thanks for the hint! Dropping this (seemingly abandoned) patch-package dependency right away...
@ds300 Please mark your repo and npm package as no longer maintained. With more than 8 million weekly downloads I feel like people deserve to know up front.
"Fix broken node modules instantly" - including your own.