ds300 / patch-package

Fix broken node modules instantly 🏃🏽‍♀️💨
MIT License
10.36k stars 290 forks source link

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

Open baixjian opened 5 months ago

OlegWock commented 5 months ago

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

bsal649 commented 4 months ago

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.

malcomio commented 2 months ago

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