An unexpected error occurred: "EACCES: permission denied, open '/package.json'"

Keep falling over at this step, have tried setting 777 permissions on the working directory. No luck.

Any ideas?

:heavy_check_mark: Checking system Node.js version - found v18.20.4
:heavy_check_mark: Checking current folder permissions
:heavy_check_mark: Checking memory availability
:heavy_check_mark: Checking free space
:heavy_check_mark: Checking for latest Ghost version
:heavy_check_mark: Setting up install directory
:heavy_multiplication_x: Downloading and installing Ghost v5.96.0
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
error An unexpected error occurred: “EACCES: permission denied, open ‘/package.json’”.

yarn install v1.22.19
info If you think this is a bug, please open a bug report with the information provided in “/home/xxxx/htdocs/xxxx.com/versions/5.96.0/yarn-error.log”.
info Visit yarn install | Yarn for documentation about this command.

Exit code: 1

Debug Information:
OS: Ubuntu, v22.04.5 LTS
Node Version: v18.20.4
Ghost-CLI Version: 1.26.1
Environment: production
Command: ‘ghost install’

Scoot up one directory (cd..) and ls -ltr to see what the permissions on the ghost directory are. Also check that package.json exists.

package.json doesn’t exist, as I assume its created as part of the install. If I touch a package.json file I get errors saying the director isnt empty.

I’ve tried making everything 777 and made sure the user has permissions, and still nothing.

I just realised it was referring to the package.json at ROOT even though it can’t be installed as root. Set to 777 temporarily and that worked Thank you!

1 Like