Can't patch package
Just installed [email protected] and modified my package in node_modules and tried to run npx patch-package lottie-react-native but ended up with error.
npx patch-package lottie-react-native
patch-package 6.4.6
• Creating temporary folder
• Installing [email protected] with npm
{
status: 1,
signal: null,
output: [ null, null, null ],
pid: 17928,
stdout: null,
stderr: null,
error: null
}
/Users/name/folder/appName/node_modules/patch-package/dist/makePatch.js:218
throw e;
^
{
status: 1,
signal: null,
output: [ null, null, null ],
pid: 17928,
stdout: null,
stderr: null,
error: null
}
Thanks for the report! ❤️
Fixed in https://github.com/ds300/patch-package/releases/tag/v6.4.7
still get the same error at @v6.4.7 @ds300
patch-package 6.4.7 • Creating temporary folder • Installing [email protected] with npm { status: 254, signal: null, output: [ null, null, null ], pid: 38727, stdout: null, stderr: null, error: null }
/Users/zhuguifeng/Documents/webank/init/node_modules/patch-package/dist/makePatch.js:218 throw e; ^ { status: 254, signal: null, output: [ null, null, null ], pid: 38727, stdout: null, stderr: null, error: null }
still get the same error at @v6.4.7 @ds300
patch-package 6.4.7 • Creating temporary folder • Installing [email protected] with npm { status: 254, signal: null, output: [ null, null, null ], pid: 38727, stdout: null, stderr: null, error: null }
/Users/zhuguifeng/Documents/webank/init/node_modules/patch-package/dist/makePatch.js:218 throw e; ^ { status: 254, signal: null, output: [ null, null, null ], pid: 38727, stdout: null, stderr: null, error: null }
I met it when doing npx patch-package showdown-highlight
I still see this with [email protected]. I ran pnpm exec patch-package vue-router and got the error with status 1
Same error with "patch-package": "^6.4.7". I ran npx patch-package @strapi/admin and I got
{
status: 1,
signal: null,
output: [ null, null, null ],
pid: 22699,
stdout: null,
stderr: null,
error: null
}
/Users/alonsosalas/Globant/Cerifi/authoring/node_modules/patch-package/dist/makePatch.js:218
throw e;
^
{
status: 1,
signal: null,
output: [ null, null, null ],
pid: 22699,
stdout: null,
stderr: null,
error: null
}```
same error with npx patch-package export-from-json
I had a problem with package react-native-track-player. For my case it was an error while command npm install running inside temporary folder, which was caused by using Apple M1 processor. Error is:
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Microsoft/ApplicationInsights-node.js-native-metrics/releases/download/v0.0.7/native_metrics-v0.0.7-node-v83-darwin-arm64-unknown.tar.gz
After some debugging, I realized that patch-package picking npm version 2, which always installs all peerDependencies, which resulting to this error.
After digging for a while, I found that I have a package latest installed for unknown reason, which depends on npm@2, and patch-package pick that npm from node_modules, instead of system-wide npm.
Removing latest package fixed my problem.
The same error for npx patch-package @react-native-community/cameraroll
version 6.4.7
@Strate
For my case it was an error while command
npm installrunning inside temporary folder
How did you get access to this error?
@Strate
For my case it was an error while command
npm installrunning inside temporary folderHow did you get access to this error?
First, I installed patch-package to dependencies: npm install patch-package
Then, go to node_modules/patch-package/dist/makePatch.js, find lines like spawnSafe_1.spawnSafeSync(npm, ["i", "--force"], {, and change stdio: "ignore", to stdio: "inherit", or stdio: "pipe",.
Ran into this same issue but with yarn instead of NPM.
Had a yarn package I wanted to patch that had a separate dependency that was of a different version than specified in the yarn package. Yarn default behavior is to let you choose which version on to install upon yarn installation, but this was not happening in the makePatch.js file.
So per @Strate - we added stdio: "inherit" to the makePatch.js file when yarn is used (line 72) and then patch-package'd patch-package with this change. This then bypassed the version issue when patch-package was trying to run the yarn install function in makePatch.js and allowed us to make the patch file
I ran into this issue trying to run yarn patch-package <package_name> in vscode terminal.
It failed, but for some reason it mac's terminal it worked fine without any changes applied to patch-package.
I checked and the node and yarn versions were same between both terminals.
In case you find this issue:
nvm use 16 && npx patch-package <package_name>
Happy new year!
Just check if you are attempting to create file in your system path.Remember to use root identity for npm install/npx patch-package
sudo su
@Strate
For my case it was an error while command
npm installrunning inside temporary folderHow did you get access to this error?
First, I installed
patch-packageto dependencies:npm install patch-packageThen, go to
node_modules/patch-package/dist/makePatch.js, find lines likespawnSafe_1.spawnSafeSync(npm, ["i", "--force"], {, and changestdio: "ignore",tostdio: "inherit",orstdio: "pipe",.
thanks for the tip.
the reason this happens to me is, i changed the registry in ~/.npmrc to my company's private registry, which doesn't have the library that i want to patch, and patch-package seems always read the .npmrc file in the root folder.
after changing the registry back to the default one (registry=https://registry.npmjs.org/), everything starts working.
@Strate
For my case it was an error while command
npm installrunning inside temporary folderHow did you get access to this error?
First, I installed
patch-packageto dependencies:npm install patch-packageThen, go to
node_modules/patch-package/dist/makePatch.js, find lines likespawnSafe_1.spawnSafeSync(npm, ["i", "--force"], {, and changestdio: "ignore",tostdio: "inherit",orstdio: "pipe",.
In my case, 'yarn' does not work', but finally I chaged yarn with npx. With above tip, npx works fine.
i am using Yarn and path package v8.0.0. Still encountering this issue in Node v20.5.0 . Can anyone help
I got the same error
before I use yarn patch-package <package-name>
after use npx patch-package <package-name> and work now
@Strate
For my case it was an error while command
npm installrunning inside temporary folderHow did you get access to this error?
First, I installed
patch-packageto dependencies:npm install patch-packageThen, go to
node_modules/patch-package/dist/makePatch.js, find lines likespawnSafe_1.spawnSafeSync(npm, ["i", "--force"], {, and changestdio: "ignore",tostdio: "inherit",orstdio: "pipe",.
Using yarn, I also needed to remove "--ignore-engines" as well. So,
replace this code
spawnSafe_1.spawnSafeSync(`yarn`, ["install", "--ignore-engines"], {
cwd: tmpRepoNpmRoot,
logStdErrOnError: false,
});
to
spawnSafe_1.spawnSafeSync(`yarn`, ["install"], {
cwd: tmpRepoNpmRoot,
logStdErrOnError: false,
stdio: "inherit",
});
Thanks @Strate
having the same issue on Yarn and path package v8.0.0. I am still encountering this issue in Node v20.5.0.
/node_modules/patch-package/dist/makePatch.js:396 throw e; ^ { status: 1, signal: null, output: [ null, null, null ], pid: 28924, stdout: null, stderr: null, error: null }