decompress icon indicating copy to clipboard operation
decompress copied to clipboard

Getting a `ENOENT: no such file or directory`

Open george-norris-salesforce opened this issue 6 years ago • 5 comments

I'm decompressing a folder of files, I'm attempting to write them to dist folder but getting a ENOENT: no such file or directory error. Is this the normal behavior? If so, how does this library handle decompressing something like this?

https://stackoverflow.com/questions/54640595/when-decompressing-zip-in-node-enoent-no-such-file-or-directory

I'm getting the same error with nested folders.

arturojain avatar Mar 13 '19 19:03 arturojain

I've encountered the same problem. Does anyone have advice?

a1994846931931 avatar Jul 10 '19 01:07 a1994846931931

I was getting this and the originating error syscall was "link" and after looking on here it appears it doesn't handle symlinks well. The workaround is to use the filter option. https://github.com/kevva/decompress/issues/52

decompress(inputpath, outputpath, { "filter": file => { if (file.type !== "link") { return true; } return false; } }) .then(files => { ... })

bilwit avatar Nov 12 '19 18:11 bilwit

I got an ENOENT: no such file or directory error when file.type was set to file rather than directory for an entry named images/ (possibly because the entry didn't have the appropriate external attributes).

This workaround has been successful:

await decompress(zip, dir, {
  map: (file) => {
    if (file.type === 'file' && file.path.endsWith('/')) {
      file.type = 'directory'
    }
    return file
  },
})

hubgit avatar Jun 05 '20 19:06 hubgit

Hit this issue on a zip coming from GitHub actions. Solution by @hubgit solved it for me. Thanks!

jasonkuhrt avatar Jan 26 '21 18:01 jasonkuhrt