{"action":"created","issue":{"url":"https://api.github.com/repos/thejoshwolfe/yauzl/issues/20","labels_url":"https://api.github.com/repos/thejoshwolfe/yauzl/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/thejoshwolfe/yauzl/issues/20/comments","events_url":"https://api.github.com/repos/thejoshwolfe/yauzl/issues/20/events","html_url":"https://github.com/thejoshwolfe/yauzl/issues/20","id":99189271,"number":20,"title":"ENOENT","user":{"login":"foxpjustin","id":13522145,"avatar_url":"https://avatars.githubusercontent.com/u/13522145?v=3","gravatar_id":"","url":"https://api.github.com/users/foxpjustin","html_url":"https://github.com/foxpjustin","followers_url":"https://api.github.com/users/foxpjustin/followers","following_url":"https://api.github.com/users/foxpjustin/following{/other_user}","gists_url":"https://api.github.com/users/foxpjustin/gists{/gist_id}","starred_url":"https://api.github.com/users/foxpjustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foxpjustin/subscriptions","organizations_url":"https://api.github.com/users/foxpjustin/orgs","repos_url":"https://api.github.com/users/foxpjustin/repos","events_url":"https://api.github.com/users/foxpjustin/events{/privacy}","received_events_url":"https://api.github.com/users/foxpjustin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-05T12:05:17Z","updated_at":"2015-08-05T17:16:02Z","closed_at":null,"body":"events.js:85\r\n      throw er; // Unhandled 'error' event\r\n            ^\r\nError: ENOENT, open 'TestZip/001.png'\r\n\r\n    at Error (native)\r\n\r\nWhen running example script on any file I get this. I don't know if it's really an error, but I'm using the example script exactly as written changing only the path to my .zip file."},"comment":{"url":"https://api.github.com/repos/thejoshwolfe/yauzl/issues/comments/128079636","html_url":"https://github.com/thejoshwolfe/yauzl/issues/20#issuecomment-128079636","issue_url":"https://api.github.com/repos/thejoshwolfe/yauzl/issues/20","id":128079636,"user":{"login":"thejoshwolfe","id":87436,"avatar_url":"https://avatars.githubusercontent.com/u/87436?v=3","gravatar_id":"","url":"https://api.github.com/users/thejoshwolfe","html_url":"https://github.com/thejoshwolfe","followers_url":"https://api.github.com/users/thejoshwolfe/followers","following_url":"https://api.github.com/users/thejoshwolfe/following{/other_user}","gists_url":"https://api.github.com/users/thejoshwolfe/gists{/gist_id}","starred_url":"https://api.github.com/users/thejoshwolfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejoshwolfe/subscriptions","organizations_url":"https://api.github.com/users/thejoshwolfe/orgs","repos_url":"https://api.github.com/users/thejoshwolfe/repos","events_url":"https://api.github.com/users/thejoshwolfe/events{/privacy}","received_events_url":"https://api.github.com/users/thejoshwolfe/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T17:16:02Z","updated_at":"2015-08-05T17:16:02Z","body":"It looks like `fs.createWriteStream()` is trying to create a file called `001.png` in a directory called `TestZip`, but the directory `TestZip` does not exist. I recommend using [path.dirname](https://nodejs.org/api/path.html#path_path_dirname_p) and either [fs.mkdir](https://nodejs.org/api/fs.html#fs_fs_mkdir_path_mode_callback) or possibly a \"mkdirp\"-like utility function from an npm module to create the directory for each entry before trying to extract it.\r\n\r\nReally, the example code in the README needs this functionality to be complete, but it's a bit complicated and not directly relevant to this library. For that reason, I just left in the comment `// ensure parent directory exists, and then:` instead of actually providing code that does that."}}