EvanOxfeld / node-unzip

node.js cross-platform unzip using streams
MIT License
613 stars 343 forks source link

`me.error` is not a function #107

Open Fohlen opened 7 years ago

Fohlen commented 7 years ago

In the following example, running node v7.10.0 I get

TypeError: me.error is not a function
    at Writer (/Users/berger/workspace/inexor-flex/node_modules/unzip/node_modules/fstream/lib/writer.js:34:23)
    at new Extract (/Users/berger/workspace/inexor-flex/node_modules/unzip/lib/extract.js:30:16)
    at Object.Extract (/Users/berger/workspace/inexor-flex/node_modules/unzip/lib/extract.js:16:12)
    at repl:1:17
    at ContextifyScript.Script.runInThisContext (vm.js:23:33)
    at REPLServer.defaultEval (repl.js:339:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.onLine (repl.js:536:10)
    at emitOne (events.js:101:20)

The example code is

const unzip = require('unzip')
const fs = require('fs')
const path = require('path')
const process = require('process')

let filePath = path.join(process.cwd(), 'somezip.zip')
let file = fs.createReadStream(filePath)
    .pipe(unzip.Extract({
        path: filePath.substr('.zip', '')
    }))

Am I using unzip wrong here?

ChengYurou commented 5 years ago

the same error occurred in node v8.12.0