News for hackers. Stuff that matters.
Re:Show HN: Quickfix, the best stupid idea for fixing proble... by partycoder on Friday November 17, 2017 @12:45AM (#15719292)
A safer way in my opinion is to:

0. read module license

1. checkout the module to be patched

2. modify it

3. do "npm pack" to save a tarball

4. set the dependency version in your package.json to the tarball. and make sure to the tarball is available during build time.

5. report the issue in their issue tracker for long term fix.

In contrast:

with this "quick fix", the dependency can change, or the transient dependencies can change. This would cause the quickfix patch to not apply anymore.

The only way to guarantee that it won't break is to save the module and all its dependencies. Something that is equivalent to npm pack.

Finally... don't get yourself into a licensing problem. Take a good look at the license before modifying a project.

Re:Show HN: Quickfix, the best stupid idea for fixing proble... by charlesetc on Friday November 17, 2017 @01:58AM (#15719726)
Does npm even allow you to use projects that don't allow you to make changes to their code?
Re:Show HN: Quickfix, the best stupid idea for fixing proble... by partycoder on Friday November 17, 2017 @02:11AM (#15719796)
You can have an npm module with any arbitrary licensing.

https://docs.npmjs.com/files/package.json#license

Re:Show HN: Quickfix, the best stupid idea for fixing proble... by drostie on Friday November 17, 2017 @08:59AM (#15721969)
No because how the hell would they know?

I author a module for my employer and describe it with their developers@ email and as UNLICENSED; how does NPM discover that I am legally authorized to use and modify this package?

Re:Show HN: Quickfix, the best stupid idea for fixing proble... by jogjayr on Friday November 17, 2017 @02:07AM (#15719777)
As in it checks the license in the source repo and prevents installation of dependencies with licenses that prohibit source modification?