NodeJS Zip Support on Heroku


I'm looking to be able to zip a file on heroku and send it back to the client. Locally, during development I used this method. It worked great. However, if you do this on heroku you'll get an error:

zip stderr: execvp(): No such file or directory

Looks like zip is not supported on Heroku's instances. Therefore I went to try node-native-zip and this worked locally, but the file is corrupt when I download and I cannot get it to upen via the OSX Utility. However, it opens via the CLI with unzip (known issue).

So the question is, if I want to zip a folder on heroku and send it to the user, what npm module should I use? Or is there something thats better or simpler that I'm not thinking of? The end result I'm after is the ability to deliver a folder to the end user via the browser, easily. Zip seemed like the best method. But the libraries out there don't seem to cut it. Thoughts?

Problem courtesy of: Donn Felker


I ended up using node-native-zip to solve my zipping issues on Heroku and abandoned the approach above and it worked fine.

Solution courtesy of: Donn Felker


There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.