Unable to Start Ghost - Cannot find module '/usr/bin/ghost'

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

I am unable to start Ghost.

  • What’s your URL? This is the easiest way for others to debug your issue
    http://blog.linuxdeveloper.io

  • What version of Ghost are you using?
    3.13.4 upgrading to 3.19.2

  • What configuration?
    Standard configuration.

  • What browser?
    Firefox

  • What errors or information do you see in the console?

      Stopped Ghost systemd service for blog: blog-linuxdeveloper-io.
      Jun 15 20:39:32 p-eu-web-0 systemd[1]: Started Ghost systemd service for blog: blog-linuxdeveloper-io.
      Jun 15 20:39:32 p-eu-web-0 node[4943]: internal/modules/cjs/loader.js:969
      Jun 15 20:39:32 p-eu-web-0 node[4943]:   throw err;
      Jun 15 20:39:32 p-eu-web-0 node[4943]:   ^
      Jun 15 20:39:32 p-eu-web-0 node[4943]: Error: Cannot find module '/usr/bin/ghost'
      Jun 15 20:39:32 p-eu-web-0 node[4943]:     at Function.Module._resolveFilename (internal/modules/cjs/loader.j
      Jun 15 20:39:32 p-eu-web-0 node[4943]:     at Function.Module._load (internal/modules/cjs/loader.js:842:27)
      Jun 15 20:39:32 p-eu-web-0 node[4943]:     at Function.executeUserEntryPoint [as runMain] (internal/modules/r
      Jun 15 20:39:32 p-eu-web-0 node[4943]:     at internal/main/run_main_module.js:17:47 {
      Jun 15 20:39:32 p-eu-web-0 node[4943]:   code: 'MODULE_NOT_FOUND',
      Jun 15 20:39:32 p-eu-web-0 node[4943]:   requireStack: []
      Jun 15 20:39:32 p-eu-web-0 node[4943]: }
      Jun 15 20:39:32 p-eu-web-0 systemd[1]: ghost_blog-linuxdeveloper-io.service: Main process exited, code=exited
      Jun 15 20:39:32 p-eu-web-0 systemd[1]: ghost_blog-linuxdeveloper-io.service: Failed with result 'exit-code'.
    
  • What steps could someone else take to reproduce the issue you’re having?
    Upgrade from 3.13.4 to 3.19.2 and try to start Ghost.

  • Steps I’ve taken to try to address the issue?
    I have ran:

ghost update --force
ghost upgrade --force (is this the same as ghost update?)

I have ran ghost doctor and confirmed:

blog@server:/var/www/ghost$ ghost doctor
✔ Checking system Node.js version
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking operating system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_blog-linuxdeveloper-io
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies

And then I run
ghost start

No matter what I do, it always fails with the same error that it cannot find the /usr/bin/ghost module. I have confirmed that there does exist a binary at /usr/bin/ghost and that I can call it with /usr/bin/ghost --version.

I am out of ideas. Please help me start ghost!

Thank you.

I solved this.

The issue was that the permissions on the versions/3.19.2/ files were 640 and they should have been 644.

It is unclear why they are permissioned to 640 upon installation, although I was able to reproduce this issue multiple times.
It is unclear why the ghost doctor didn’t show permission errors.

I fixed it by issuing the following command:

chmod -R o+r versions/3.19.2

Total downtime 18 hours.

1 Like