question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Creating patch file for GitHub dependency fails

See original GitHub issue

Hi! 👋

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:open
  • Created 2 years ago
  • Reactions:12
  • Comments:5

github_iconTop GitHub Comments

5reactions
mtwomeycommented, May 17, 2022

+1 Please merge.

3reactions
dijonkitchencommented, Jul 21, 2022

Might want to make a pull request for this to merge. This is just an issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found