@mrmooky Have you tried with sudo?
Ref: https://discuss.circleci.com/t/error-eacces-permission-denied-scandir-root-npm-logs/30379
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm using Browsershot by Spatie to generate PDF files for certain views in a Laravel app. It works fine on my local machine, but only sometimes on my production server (Ubuntu 20, PHP 8).
I'm using Horizon to generate the PDF files. Sometimes, it works directly on the first try, but most of the time the job fails with the below error. When I re-try the job, the file is generated without errors. Not sure how to fix this.
Error Output:
================
glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path: '/root/.npm/_logs'
}
TimeoutError: Navigation timeout of 30000 ms exceeded
at /usr/lib/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
at /home/..../releases/20210629110947/vendor/spatie/browsershot/src/Browsershot.php:797)
It's obviously a permission issue, but I'm not sure how to fix it, as it works fine the second time. Anybody got an idea?
Please or to participate in this conversation.