subhamX / notion-easy-export

📘 Notion easy export converts your notion documents & databases into an ebook.
https://www.npmjs.com/package/notion-easy-export
Apache License 2.0
62 stars 4 forks source link

EACCES Error on macOS #2

Open subhamX opened 2 years ago

subhamX commented 2 years ago

Problem

On macOS you might face EACCES error. I don't know if it's the default behaviour across all packages accessing files on macOS.

node:events:505
      throw er; // Unhandled 'error' event
      ^

Error: EACCES: permission denied, open '/Users/canary/Desktop/tmp/session_files/tmp/data.zip'
Emitted 'error' event on WriteStream instance at:
    at WriteStream.onerror (node:internal/streams/readable:773:14)
    at WriteStream.emit (node:events:527:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/Users/canary/Desktop/tmp/session_files/tmp/data.zip'
}

Temporary Solution

For now please consider using sudo command while executing the main script.

sudo node main.js

Expected Solution

Explore other packages way of accessing files, and make the package work without sudo. 🙂