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

"Not a directory" error when running 'notion-pdf-export' shell script on some macOS systems #22

Open
mixelpixel opened this issue Apr 21, 2021 · 15 comments
Labels
bug Something isn't working

Comments

@mixelpixel
Copy link

Terminal.app flashes up for a hot milisecond, but after placing Notion's HTML export (including sub-pages) files in the app folder, the job never loads. This command is invoked:

/Users/this_user/Desktop/notion-pdf-export_mac_1/notion-pdf-export ; exit;

But no PDFs.

Using zsh.

@ganeshh123
Copy link
Owner

Is this an M1 or Intel Mac? Could you try running the application from the terminal, and see what the error message was?

Alternatively, try running the npe file as an executable in the terminal:

chmod +x ./npe
./npe

@mixelpixel
Copy link
Author

2.9 GHz Quad-Core Intel Core i7

This worked! Thank you so much!!

Alternatively, try running the npe file as an executable in the terminal:

chmod +x ./npe
./npe

@mixelpixel
Copy link
Author

I feel like I should have known how to do that

@ganeshh123
Copy link
Owner

Hmm, it should be working when just double clicking the file though.
Could you try running

./notion-pdf-export

in the terminal, and show me what the error says?

@mixelpixel
Copy link
Author

huh... says

% ./notion-pdf-export 
./notion-pdf-export: line 3: cd: ./notion-pdf-export/..: Not a directory

Please add some HTML files to this folder

Close this Window to Exit
-------------------------------

and that was invoked in the directory which has the executable file, notion-pdf-export

% ls -al
drwx------@   10        320 Apr 22 13:32 .
drwx------@   57       1824 Apr 22 14:41 ..
-rw-r--r--@    1      14340 Apr 22 14:46 .DS_Store
-rw-r--r--@    1       1065 Sep 29  2020 LICENSE
-rwxr-xr-x@    1         29 Sep 29  2020 notion-pdf-export
-rwxr-xr-x@    1   39522130 Sep 29  2020 npe
drwxr-xr-x  3663     117216 Apr 22 13:37 pdfs
drwxr-xr-x@    3         96 Sep 29  2020 utils

@ganeshh123
Copy link
Owner

Thanks a lot, I'll look into it!

@ganeshh123 ganeshh123 added the bug Something isn't working label Apr 23, 2021
@ganeshh123 ganeshh123 changed the title Unable to get beyond invoking notion-pdf-export macOS Big Sur "Not a directory" error when running 'notion-pdf-export' shell script on some macOS systems Apr 23, 2021
@Scankiran
Copy link

Guys, you have to give permission then you should system requirements -> Security. When you run program it won't be work because of Security. You should stop then select 'open anyway' on Security. You should do two times when run program. After all of, program can work perfectly. And It has already saved me hours. Thanks a lot!

@ganeshh123
Copy link
Owner

ganeshh123 commented May 13, 2021

Guys, you have to give permission then you should system requirements -> Security. When you run program it won't be work because of Security. You should stop then select 'open anyway' on Security. You should do two times when run program. After all of, program can work perfectly. And It has already saved me hours. Thanks a lot!

Thank you! That could be it, I forgot to include that in the instructions. Usually, it's supposed to say "cannot run because unidentified developer" but maybe the error doesn't show when running through a shell script, so you might have to do it twice, like you said.
I'll try and add this to the docs at some point:
image

@thibdonz
Copy link

thibdonz commented Aug 9, 2022

Hi @ganeshh123,

Unfortunately, it doesn't work for me. Here is the error message.

Can you please help me ? Thanks in advance !!

`Last login: Tue Aug 9 16:39:30 on ttys000
/Users/thibaud/Desktop/notion-pdf-export_mac_1.3.0/notion-pdf-export ; exit;
thibaud@MacBook-Pro-de-DONZIER-2 ~ % /Users/thibaud/Desktop/notion-pdf-export_mac_1.3.0/notion-pdf-export ; exit;
/Users/thibaud/Desktop/notion-pdf-export_mac_1.3.0/notion-pdf-export: line 3: cd: /Users/thibaud/Desktop/notion-pdf-export_mac_1.3.0/notion-pdf-export/..: Not a directory
/Users/thibaud/Desktop/notion-pdf-export_mac_1.3.0/notion-pdf-export: line 5: ./npe: No such file or directory

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Opération terminée]

`

@ganeshh123
Copy link
Owner

@thibdonz I am still not sure what causes it, in the mean time, could you try doing what is described in the second comment of this issue?

@thibdonz
Copy link

yes and get this message.

`Last login: Sun Aug 14 20:59:27 on ttys000
/Users/donzierthibaud/Desktop/notion-pdf-export_mac_1.3.0/npe ; exit;
donzierthibaud@MacBook-Pro-de-DONZIER-2 ~ % /Users/donzierthibaud/Desktop/notion-pdf-export_mac_1.3.0/npe ; exit;
fs.js:115
throw err;
^

Error: EPERM: operation not permitted, scandir '/Users/donzierthibaud/.Trash'
at Object.readdirSync (fs.js:783:3)
at Object.readdirSync (/Users/donzierthibaud/Desktop/notion-pdf-export_mac_1.3.0/npe:191:50)
at getAllFilePaths (/snapshot/src/get_all_filepaths.js:11:26)
at files.forEach (/snapshot/src/get_all_filepaths.js:15:7)
at Array.forEach ()
at getAllFilePaths (/snapshot/src/get_all_filepaths.js:13:9)
at readHtmlFiles (/snapshot/src/read_html_files.js:8:20)
at Object. (/snapshot/index.js:18:17)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Opération terminée]

`

@ganeshh123
Copy link
Owner

Oh, sorry. Do you know how to use NodeJS?

@thibdonz
Copy link

thibdonz commented Aug 14, 2022 via email

@ganeshh123
Copy link
Owner

Another alternative is if you have a Windows machine or Parallels, the Windows version doesn't have this issue, might be worth trying with that.

@rubenvl2
Copy link

This can be solved following these steps:

  1. Follow the instructions to place the tool inside of the html folder
  2. open terminal and go to the folder
  3. run sh notion-pdf-export
  4. it will throw an error to move to trash for not allowed, cancel it
  5. go to security settings, a new alert indicating this will appear, allow anyway, will require password
  6. repeat 3
  7. a new error, but now for the pdf utily will appear, cancel it, repeat step 5 in security, the pdf tool will be there
  8. repeat 3

and with that, all PDFs will be generated. Only requires extra security concerns to be allowed.

:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants