Fork and patch npm modules hosted on GitHub

This originally appeared on coderwall.

I have read How to fork & patch npm modules and followed the instructions but I couldn't make it work for me. Looking at npm log I figured that the problem was with zip files being downloaded and not tarballs. So here's the trick on how to include your GitHub repository correctly in npm:

  1. Go to fork's page
  2. Go to commits
  3. On the right side of the commit you want to use click "Browse code"
  4. On the browse code page right-click on "Download ZIP" button (or whatever it is that you are seeing) and copy the URL. It should be something like this
  5. Edit that URL replacing archive with tarball and removing the .zip extension. You should end up with something like
  6. Paste that into your package.json instead of the version. Like this:
"express-jsend": ""  

And that's it - npm install works as it should and installs the module from the link.


Ivan Erceg

Software shipper, successful technical co-founder, $1M Salesforce Hackathon 2014 winner