I
I
Ivan Driuk2020-09-14 02:46:45
JavaScript
Ivan Driuk, 2020-09-14 02:46:45

What is the best way to fix if there is a bug in the npm package of the thirdparty library?

Please tell me, what can I do if I need to make changes to a third-party library so that there is a minimum of difficulties in the future? For example, there is a glitch in some ui library, you can go to node_modules , find the dist folder of either and fix it in it, it will work on the local computer, but when someone spools the repository from the github, he will have this glitch. Is there a sample postinstall script to change the file in node_modules to a pre-saved patched file? Or a smarter way? Maybe you have come up with some kind of utility for such cases?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kirill Romanov, 2020-09-24
@IDriuk

https://www.npmjs.com/package/patch-package

M
Maxim Morev, 2020-09-14
@SeaInside

Fork, fix, specify your fork in the dependencies instead of the original package.

P
profesor08, 2020-09-14
@profesor08

Make a pull request to fix the bug.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question