Permissions issue using node-archiver

952 Views Asked by At

When I use archiverjs I cannot open the resulting zip file:

var archive = archiver('zip');
  var output = fs.createWriteStream(projectName + '.zip');
archive.pipe(output);

  archive.on('error', function(err) {
    throw err;
  });
  output.on('close', function() { 
    console.log('Package complete!');
  });
  archive.bulk([
    {expand: true, cwd: projectPath, src:['**/*'], data: {mode: 0755}}
  ]).finalize();

The zip file gets created but I dont have permissions to open it. What am I doing wrong?

0

There are 0 best solutions below