Difficulty Installing Ghost CMS on Ubuntu Server

Hello everyone,

I’m encountering some issues while trying to install Ghost CMS on my Ubuntu server. Here’s a breakdown of the problem:

  1. Installation Process: I followed the official installation guide for Ubuntu, but when I run the installation command sudo npm install ghost-cli@latest -g, it throws an error message.
  2. Error Message: The error message I receive is: “Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’”. It seems like a permission issue, but I’m not sure how to resolve it.
  3. Node.js and npm Version: I’ve made sure to have the latest versions of Node.js and npm installed on my server.
  4. Permissions: I’ve tried running the installation command with sudo, but it still gives the same permission denied error.
  5. Previous Experience: I’ve successfully installed other Node.js applications on this server before without any issues, so I’m not sure why Ghost CMS installation is causing problems.

Any guidance or suggestions on how to troubleshoot and resolve this issue would be greatly appreciated. Thank you in advance for your help!

Did you follow these steps to install node?

curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash
sudo apt install --yes nodejs
sudo npm install ghost-cli@latest -g

Nonetheless, I suspect the permissions for /usr/local/lib/node_modules is set to root rather than the local user.

Thank you for your assistance! I followed the steps you provided, and indeed, the permissions for /usr/local/lib/node_modules were set to root. I adjusted the permissions accordingly, and now I’ve successfully installed Ghost CMS without encountering any permission denied errors. I appreciate your help in resolving this issue!

2 Likes