Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a ENOENT: no such file or directory #68

Open
george-norris-salesforce opened this issue Feb 11, 2019 · 5 comments
Open

Getting a ENOENT: no such file or directory #68

george-norris-salesforce opened this issue Feb 11, 2019 · 5 comments

Comments

@george-norris-salesforce

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

@arturojain
Copy link

I'm getting the same error with nested folders.

@a1994846931931
Copy link

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

@bilwit
Copy link

bilwit commented Nov 12, 2019

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.
#52

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

@hubgit
Copy link

hubgit commented Jun 5, 2020

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
  },
})

@jasonkuhrt
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants