Hello guys,
I know this is kinda the common problem everybody encounter. However, I have searched through the whole forum for error on EACCES but unfortunately I cannot find any working solution, neither understand what is wrong with my installation.
I tried to instantiate a new Ghost v4.2.1 under /var/www/myghost/
using ghost install
as written on the official guide.
The creation went well. I got the following folder tree :
-rw-r--r-- 1 adghost adghost 571 avril 14 20:30 config.production.json
drwxr-xr-x 8 ghost ghost 4096 avril 14 20:12 content
lrwxrwxrwx 1 adghost adghost 36 avril 14 20:25 current -> /var/www/myghost/versions/4.2.1
drwxr-xr-x 3 adghost adghost 4096 avril 14 20:12 versions
However when I tried to launch ghost run
, I got the following EACCES error :
The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead. + sudo node current/index.js internal/fs/utils.js:269 throw err;
^
Error: EACCES: permission denied, open '/var/www/myghost/versions/4.2.1/node_modules/moment-timezone/index.js'
at Object.openSync (fs.js:462:3)
at Object.readFileSync (fs.js:364:35)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1025:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/var/www/myghost/versions/4.2.1/core/server/overrides.js:8:16)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) {
errno: -13,
syscall: 'open',
code: 'EACCES',
path: '/var/www/myghost/versions/4.2.1/node_modules/moment-timezone/index.js'
}
I know that this is related to some ownership or R/W permissions on some files for nodejs
. But when I tried to display the permission for the related file, everything seems ok (see below)
adghost@raspberrypi:/var/www/myghost $ ll /var/www/myghost/versions/4.2.1/node_modules/moment-timezone/index.js
-rwxr-x--- 1 adghost adghost 116 févr. 13 00:01 /var/www/myghost/versions/4.2.1/node_modules/moment-timezone/index.js
At this point, we can see that /var/www/myghost/versions/4.2.1/node_modules/moment-timezone/index.js
belongs to adghost
and this is the user used to run ghost run
(and also ghost start
). However, the error seems to tell otherwise (as if adghost
doesn’t have the right permissions).
Could somebody please help me with this ? I am stucked and have no other alternative
- How was Ghost installed and configured? → production mode using
ghost install
- What Node version, database, OS & browser are you using? → node : v12.22.0 + database : mariadb (Ver 15.1 Distrib 10.3.27-MariaDB) + OS : raspbian
- What errors or information do you see in the console? → see above
Thanks in advance for your help.
Regards,
Rahenda