daraosn / node-zip

217 stars 38 forks source link

Zip not recognized by Amazon's Lambda function #13

Closed teebu closed 8 years ago

teebu commented 9 years ago

I'm on a Windows machine, running 'Node-Lambda' https://github.com/RebelMail/node-lambda, which uses node-zip.

Trying to invoke a lambda with the zip created by node-zip, it says 'Service error.' Creating the same zip using WinRar has no problems. The problem must be with the way the zip is created.

The zip inside looks fine, and passes all tests in WinRar.

daraosn commented 9 years ago

Hi @teebu, thanks for reporting, I just bumped to node-zip@1.1.1 can you check if it's still causing issues? (maybe bump the version on the node-lambda module, inside of node_modules).

teebu commented 9 years ago

Updated to 1.1.1, still Amazon not liking the zip. Getting "Service error." from the zips created with this in Windows.

daraosn commented 9 years ago

The best in this case is to report directly to jszip, as this is just a node port of this project: https://stuk.github.io/jszip/

thinkloop commented 7 years ago

Were you able to resolve this @teebu? I am trying to use this for the same purpose.

teebu commented 7 years ago

No. I endedup using 7zip

thinkloop commented 7 years ago

Thanks! I ended up using zip-folder so as not to mess with recursively adding files and folders:

const zipFolder = require('zip-folder');

const srcFolder = './src/lambdas';
const outputFile = './build/lambdas.zip';

zipFolder(srcFolder, outputFile, (err) => {
    if (err) {
        return console.error('zip err:', err);
    }

    console.log('created zip');
});