You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Next I change the install_location to a directory on the project root, all the files to be compressed are listed correctly. But the archive is corrupt.
varinstall_location="./.tmp";
Finally I changed the script that copies the archive to wait for the copy before deleting, and everything works.
output.on('close',function(){mkdirp('./'+options.dist_folder,function(err){fs.createReadStream(install_location+'/'+archive_name+'.zip').pipe(fs.createWriteStream('./'+options.dist_folder+'/'+archive_name+'.zip')).on('close',function(){rimraf(install_location,function(){grunt.config.set('lambda_deploy.'+task.target+'.package','./'+options.dist_folder+'/'+archive_name+'.zip');grunt.log.writeln('Created package at '+options.dist_folder+'/'+archive_name+'.zip');done(true);});});});});
I'm a beginner with node js and grunt, there is there a problem in my configuration or worries with the task ?
Is it at all possible to post a link to your code so I can try and run it myself? Even if just an example that prints "Hello World" or something but still exhibits the issue?
Also, it might be useful to try a basic example using the archiver package to see if the NPM package itself is the issue or just this implementation using it.
I also tried to clone your project and run the tests. I have this error:
> grunt test
Running "clean:tests" (clean) task
Running "lambda_package:default_options" (lambda_package) task
Created package at tmp/dist/my-lambda-function_0-0-1_2015-0-29-11-55-59.zip
Running "lambda_package:custom_options" (lambda_package) task
Created package at tmp/dist/another-lambda-function_0-0-1_latest.zip
Running "nodeunit:tests" (nodeunit) task
Testing lambda_invoke_test.js..OK
Testing lambda_package_test.jsFatal error: Invalid or unsupported zip format. No END header found
had same problem with local file and buffer on ubuntu (also on AWS Lambda) so switched to another library. time permitting will try to submit something.
Activity
Tim-B commentedon Jan 29, 2015
Hi @jeromeheissler
Is it at all possible to post a link to your code so I can try and run it myself? Even if just an example that prints "Hello World" or something but still exhibits the issue?
Also, it might be useful to try a basic example using the archiver package to see if the NPM package itself is the issue or just this implementation using it.
https://www.npmjs.com/package/archiver
Cheers, Tim.
jeromeheissler commentedon Jan 29, 2015
I create a project on github with a Hello World. When I run the command grunt lambda_package I have the same problem.
https://github.com/jeromeheissler/test-lamdba
I will try to use the archiver package alone
jeromeheissler commentedon Jan 29, 2015
I also tried to clone your project and run the tests. I have this error:
teu commentedon Apr 9, 2015
Hi, same problem, empty deploy package...
Tim-B commentedon Apr 9, 2015
Hi @teu would it be possible to try a hello world example using the archiver package? https://www.npmjs.com/package/archiver
That will help narrow down if the issue is with the library which generates the zip or how it's been implemented here.
teu commentedon Apr 10, 2015
Hi,
had same problem with local file and buffer on ubuntu (also on AWS Lambda) so switched to another library. time permitting will try to submit something.
Tim-B commentedon May 23, 2015
I bumped the adm-zip version to the latest one which I hope will resolve this issue. I also tested it in a Windows 7 VM and it all worked fine.
Tim-B commentedon Jun 28, 2015
I've just released a new version including the pull request from @qen so hopefully this will be fixed. Let me know how you go.