-
-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't patch package #300
Can't patch package #300
Comments
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 @ds300patch-package 6.4.7 /Users/zhuguifeng/Documents/webank/init/node_modules/patch-package/dist/makePatch.js:218 |
I met it when doing |
I still see this with [email protected]. I ran |
Same error with "patch-package": "^6.4.7". I ran
|
same error with |
I had a problem with package
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 Removing |
The same error for |
How did you get access to this error? |
First, I installed Then, go to |
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 |
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 |
thanks for the tip. the reason this happens to me is, i changed the registry in after changing the registry back to the default one ( |
In my case, 'yarn' does not work', but finally I chaged yarn with npx. |
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 |
Using yarn, I also needed to remove 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 |
I resolved the issue by creating a patch package for diff --git a/node_modules/patch-package/dist/makePatch.js b/node_modules/patch-package/dist/makePatch.js
index d8d0925..a292026 100644
--- a/node_modules/patch-package/dist/makePatch.js
+++ b/node_modules/patch-package/dist/makePatch.js
@@ -115,12 +115,12 @@ function makePatch({ packagePathSpecifier, appPath, packageManager, includePaths
fs_extra_1.copySync(rcPath, path_1.join(tmpRepo.name, rcFile), { dereference: true });
}
});
- if (packageManager === "yarn") {
+ if (packageManager === "npm") {
console_1.default.info(chalk_1.default.grey("•"), `Installing ${packageDetails.name}@${packageVersion} with yarn`);
try {
// try first without ignoring scripts in case they are required
// this works in 99.99% of cases
- spawnSafe_1.spawnSafeSync(`yarn`, ["install", "--ignore-engines"], {
+ spawnSafe_1.spawnSafeSync(`npm`, ["install", "--ignore-engines"], {
cwd: tmpRepoNpmRoot,
logStdErrOnError: false,
});
@@ -128,7 +128,7 @@ function makePatch({ packagePathSpecifier, appPath, packageManager, includePaths
catch (e) {
// try again while ignoring scripts in case the script depends on
// an implicit context which we haven't reproduced
- spawnSafe_1.spawnSafeSync(`yarn`, ["install", "--ignore-engines", "--ignore-scripts"], {
+ spawnSafe_1.spawnSafeSync(`npm`, ["install", "--ignore-engines", "--ignore-scripts"], {
cwd: tmpRepoNpmRoot,
});
} |
still an issue:
with the help of @Strate I managed to get the full error, and I've had to modify the
to also add '--legacy-peer-deps' |
it worked for me, very helpful |
patching the patch-package resolved the issue...thank you |
this works, but why???? |
Love a bit of patch-package inception
|
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.The text was updated successfully, but these errors were encountered: