2

当我使用 archiverjs 时,我无法打开生成的 zip 文件:

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();

zip 文件已创建,但我无权打开它。我究竟做错了什么?

4

0 回答 0