ZJONSSON / node-unzipper

node.js cross-platform unzip using streams
Other
424 stars 114 forks source link

TypeError: Promise.map is not a function after upgrade to 0.11.3 #305

Closed craigcartmell closed 2 months ago

craigcartmell commented 2 months ago

Node: 18

The error relates to node_modules/unzipper/lib/Open/directory.js, line 155.

  return Promise.map(files, function(entry) {

Promise.map looks like it's a feature of bluebird: http://bluebirdjs.com/docs/api/promise.map.html

I can't see that the Bluebird promise is being imported though, so it looks like it's using the native Promise, which doesn't support the .map function?

ZJONSSON commented 2 months ago

Thanks @craigcartmell, can you give me the specific node version and platform (linux, mac windows) and the error stack?

The line you referred to is tested on node v.10 up to v.19 https://zjonsson.github.io/node-unzipper/node-unzipper/lib/Open/directory.js.html, so it's not immediately clear to me what is going on

craigcartmell commented 2 months ago

@ZJONSSON - Apologies, I think this is only breaking in our tests, which suggests a mocking issue or something strange with our test environment.

I'll close this.

ZJONSSON commented 2 months ago

Please upgrade to 0.11.4, there was a discrepancy between published and master

craigcartmell commented 2 months ago

Thanks @ZJONSSON - That fixed the issue