node-modules / compressing

Everything you need for compressing and uncompressing
MIT License
431 stars 36 forks source link

uncompress error: Error: incorrect header check #54

Closed qiufeihong2018 closed 1 year ago

qiufeihong2018 commented 3 years ago

pack.zip是axios请求createWriteStream下载而来的

  compressing.tgz.uncompress(path.join(__dirname, '../../pack.zip'), 'package').then(res => {
    console.log('uncompress success')
    // 解压之后,重启应用即可
    app.relaunch()
    app.exit(0)
  }).catch(err => {
    // 记录错误日志
    console.log(`uncompress error: ${err.toString()}`)
  })

启动后报了这个问题

portwatcher commented 3 years ago

The parser is mismatched and thats why you get incorrect header check error.

Simply replace tgz with zip will resolve the issue.

songpengyuan commented 1 year ago

The parser is mismatched and thats why you get incorrect header check error.

Simply replace tgz with zip will resolve the issue.

compressing.zip.uncompress(path.join(__dirname, '../../pack.zip'), 'package').then(res => {
    console.log('uncompress success')
    // 解压之后,重启应用即可
    app.relaunch()
    app.exit(0)
  }).catch(err => {
    // 记录错误日志
    console.log(`uncompress error: ${err.toString()}`)
  })

Thanks, I also encountered this problem.