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

Error: ENOTDIR, not a directory #78

Open
dr-nyt opened this issue Apr 14, 2020 · 2 comments
Open

Error: ENOTDIR, not a directory #78

dr-nyt opened this issue Apr 14, 2020 · 2 comments

Comments

@dr-nyt
Copy link

dr-nyt commented Apr 14, 2020

Hello,
I'm creating a desktop app that is built on Electron with AngularJS. Before building as a production app, this module works as intended, amazing work. But after packaging it into a release build, it gives the following error: Error: ENOTDIR, not a directory.

This is probably some incompatibility with angular or something and I'd like some help fixing this bug.
The download path provided is:

let option = {
      title: novel.info.name,
      author: novel.info.author,
      cover: novel.info.cover, 
      content: chapters
};
new epubGen(option, "A:\Downloads\My new book.epub");

The issue seems to originate at EPub.generateTempFile (C:\resources\app.asar\node_modules\epub-gen\lib\index.js:234):

generateTempFile() {
      var base, generateDefer, htmlTocPath, ncxTocPath, opfPath, self;
      generateDefer = new Q.defer();
      self = this;
      if (!fs.existsSync(this.options.tempDir)) {
        fs.mkdirSync(this.options.tempDir);
      }
      fs.mkdirSync(this.uuid);        <=========================== ERROR HERE
      fs.mkdirSync(path.resolve(this.uuid, "./OEBPS"));
      ...

I was wondering what uuid is for and if it could lead to fixing the bug.
Kind Regards,
dr-nyt.

@dr-nyt
Copy link
Author

dr-nyt commented Apr 14, 2020

I should probably also make it clear that I have made files and directories in that path directory using the fs module.

@dr-nyt
Copy link
Author

dr-nyt commented Apr 23, 2020

As much as I like this module, the only solution I came across was to use another module called nodepub. This module and Electron/Angular don't go well together for some reason and hopefully, a fix is found soon.

I will keep this issue open unless the dev decides to close it or a fix is found.

Daylon pushed a commit to Daylon/epub-gen that referenced this issue Sep 29, 2024
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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

1 participant