Skip to content
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

"There don't appear to be any changes" even though there are #128

Closed
baobabKoodaa opened this issue Feb 26, 2019 · 13 comments
Closed

"There don't appear to be any changes" even though there are #128

baobabKoodaa opened this issue Feb 26, 2019 · 13 comments

Comments

@baobabKoodaa
Copy link

This is my first time trying to use patch-package. I followed the instructions, but it doesn't recognize my changes. What am I doing wrong? More details below.

  1. I added "postinstall": "patch-package" inside scripts inside my project's package-json.
  2. I ran npm i patch-package
  3. I modified the package that I had problems with. In particular, I modified this file: node_modules/react-simple-infinite-scroll/package.json.
  4. I ran npx patch-package infinite-scroll

I'm seeing this:

• Creating temporary folder
• Installing react-simple-infinite-scroll@0.0.1 with npm
• Diffing your files with clean files
⁉️  Not creating patch file for package 'react-simple-infinite-scroll'
⁉️  There don't appear to be any changes.

I'm guessing patch-package doesn't support me modifying package.json inside a node module?

@ds300
Copy link
Owner

ds300 commented Feb 26, 2019

Package.json files are ignored by default because npm adds absolute paths into them when installing packages so it creates noise. See https://github.com/ds300/patch-package/blob/master/README.md#options for how to configure what to ignore.

@baobabKoodaa
Copy link
Author

Okay, thank you for the answer. I ended up using a different way to patch.

@ds300 ds300 closed this as completed Feb 26, 2019
@MariusCatanoiu
Copy link

Okay, thank you for the answer. I ended up using a different way to patch.

What way? :D

@baobabKoodaa
Copy link
Author

I forked the project and released the patched fork on npm.

@dmatora
Copy link

dmatora commented Aug 3, 2021

I am having same issue getting ("There don't appear to be any changes") with trying to patch node_modules/@pooltogether/hooks/node_modules/@pooltogether/bnc-onboard/dist/esm/connect-5e218485.js which technically is not part of the repo
I've created patch manually but when I try to apply it I'm getting an error

@mitchmeyer1
Copy link

any answers? having the same issue on a .ts file!

@reyraa
Copy link

reyraa commented Mar 21, 2023

Had the same issue patching msw.
I created a test local repo, added the package.json file of msw to the test repo and committed. Then applied the changes I needed and ran git diff.
Now all I had to do was fixing the paths.

I had

diff --git a/package.json b/package.json
index 78e36be..df071bb 100644
--- a/package.json
+++ b/package.json

which I changed to

diff --git a/node_modules/msw/package.json b/node_modules/msw/package.json
index 78e36be..df071bb 100644
--- a/node_modules/msw/package.json
+++ b/node_modules/msw/package.json

Now I have the content that I need, I just have to make patch-package to create the patch file. For this I just made a random change in a source file in the msw package and ran npx patch-package msw. Then I replied the content of the patch file with what I got from git diff.

@YewoMhango
Copy link

@ds300 I tried using npx patch-package @smooth-dnd/react --include package\\.json$ (since I had modified the package.json file of @smooth-dnd/react) as you suggested, but it was still showing no changes. Or was I doing something wrong here?

Regardless, I applied the method suggested by @reyraa and that worked for me

@vallemar
Copy link

vallemar commented Jul 5, 2023

I also have this problem, I tried --include package\\.json$ but it doesn't work

@semiaddict
Copy link

I also have this problem, I tried --include package\\.json$ but it doesn't work

This seems to work: npx patch-package package-name --exclude (see #142 (comment))

@YG1ee
Copy link

YG1ee commented Jul 20, 2023

@semiaddict Thanks for the solution. It totally worked for me!

@bertyhell
Copy link

bertyhell commented Sep 21, 2023

I used this, if you only have changes in package.json, and you still want to ignore package-lock.json:

npx patch-package package-name --exclude "" --include package.json

@stevenqzhang
Copy link

@bertyhell your solution didn't work for me for some reason but @semiaddict 's did

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests