Creating patch file for GitHub dependency fails
See original GitHub issueHi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch patch-package@6.4.7
for the project I’m working on.
Closes #288
Here is the diff that solved my problem:
diff --git a/node_modules/patch-package/dist/getPackageResolution.js b/node_modules/patch-package/dist/getPackageResolution.js
index bc7ffaa..287a2f1 100644
--- a/node_modules/patch-package/dist/getPackageResolution.js
+++ b/node_modules/patch-package/dist/getPackageResolution.js
@@ -65,7 +65,7 @@ function getPackageResolution({ packageDetails, packageManager, appPath, }) {
lockFileStack.reverse();
const relevantStackEntry = lockFileStack.find((entry) => entry.dependencies && packageDetails.name in entry.dependencies);
const pkg = relevantStackEntry.dependencies[packageDetails.name];
- return pkg.resolved || pkg.from || pkg.version;
+ return pkg.resolved || pkg.version || pkg.from;
}
}
exports.getPackageResolution = getPackageResolution;
This issue body was partially generated by patch-package.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:12
- Comments:5
Top Results From Across the Web
Creating patch file for GitHub dependency fails with ENOENT ...
I was trying to create a patch for a GitHub dependency I added to my projects like this in package.json: "react-native-scrollable-tab-view": ...
Read more >Patch fails when created with v5 · Issue #36 - GitHub
I get the following This error was caused because Git cannot apply the following patch file: patches/react-scripts+1.0.17.patch This is ...
Read more >Dependencies dependencies `package.json` patch will fail ...
A patch gets generated. I apply it using patch-package. Everything works as expected: Dependency bar has been moved to peerDependency bar .
Read more >Inconsistent information provided when patching fails · Issue #20
i.e. make changes, run `patch-package react-native-deprecated-custom-components`, and commit. To manually fix a patch file, Run: patch -p1 -i ...
Read more >ds300/patch-package: Fix broken node modules instantly ♀️
Run patch-package without arguments to apply all patches in your project. Options. --error-on-fail. Forces patch-package to exit with code 1 after failing ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 Please merge.
Might want to make a pull request for this to merge. This is just an issue.