patch-package icon indicating copy to clipboard operation
patch-package copied to clipboard

Can patch-package detect content changes in package.json? Let's say I changed a dependency version?

Open baixjian opened this issue 1 year ago • 3 comments

baixjian avatar Apr 26 '24 07:04 baixjian

https://github.com/ds300/patch-package/issues/341

OlegWock avatar Apr 30 '24 12:04 OlegWock

Yes with the method above, or by manually editing the diff. It probably won't help you though, e.g. if you're trying to change peer deps to stop getting warnings/errors with npm update/install.

I believe npm uses its online registry to resolve peerDeps. You can stop warnings with npm install (not update) by changing the peerDependencies for the package in question in your own package-lock.json.

bsal649 avatar May 21 '24 04:05 bsal649

I think the best way to handle this would be to use overrides in your package.json file to specify the version that you want

see https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides and https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions

malcomio avatar Jul 12 '24 12:07 malcomio