ds300 / patch-package

Fix broken node modules instantly ๐Ÿƒ๐Ÿฝโ€โ™€๏ธ๐Ÿ’จ
MIT License
10.44k stars 295 forks source link

Patch a package.json file? #341

Closed selfagency closed 2 years ago

selfagency commented 3 years ago

I'm trying to fix a broken dependency in a node module within my project by altering the dependency version in the module's package.json but the diff doesn't seem to recognize it. Is there a config flag I need or something?

๐Ÿ“‚ code/directlink-portal โ‹… ๎‚  feat/AI-218-Page-scaffolding [$โœ˜!+] via ๐Ÿณ default โ‹… ๐Ÿ“ฆ v0.1.23 โ‹… ๏ข˜ v16.7.0 ยป 1m5s 
15:11:30 โœ–1 โžœ micro node_modules/@storybook/vue/package.json

๐Ÿ“‚ code/directlink-portal โ‹… ๎‚  feat/AI-218-Page-scaffolding [$โœ˜!+] via ๐Ÿณ default โ‹… ๐Ÿ“ฆ v0.1.23 โ‹… ๏ข˜ v16.7.0 ยป 12s 
15:12:00 โžœ npx patch-package @storybook/vue              
patch-package 6.4.7
โ€ข Creating temporary folder
โ€ข Installing @storybook/vue@6.3.7 with npm
โ€ข Diffing your files with clean files
โ‰๏ธ  Not creating patch file for package '@storybook/vue'
โ‰๏ธ  There don't appear to be any changes.
luisaverza commented 3 years ago

I think this issue is duplicated. Maybe this response could help https://github.com/ds300/patch-package/issues/49#issuecomment-646581987

zoxon commented 2 years ago

This works for me

npx patch-package some-package --exclude 'nothing'
mzvast commented 2 years ago
--exclude 'nothing'

It works like charm! Excellent~

selfagency commented 2 years ago

Thanks all

charlesritchea commented 6 months ago

This might technically "work" but if what you're trying to patch is a dependency that should be a devDependency then it won't have any effect