ds300 / patch-package

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

Can `patch-package` be used to modify postinstall script of other npm? #472

Open yiliang114 opened 1 year ago

yiliang114 commented 1 year ago

Such as vscode-ripgrep, It has a postinstall script. In some scenarios, I need to install this package, but I don't want it to execute postinstall script.

image

Can I modify postinstall script content through patch-package? It seems that it is not possible, because patch-package needs to execute its own postinstall script to modify the dependency content under the node_modules after installing the dependency, but at the same time, the postinstall scripts of other packages are already being executed.

lemontree2000 commented 9 months ago

I have the same need. How did you solve it? @yiliang114

Leonewu commented 7 months ago

There are some "postinstall broken" npm packages too.Seems there is not a workaround about the problem.