Ghost-CLI: Missing package(s): nginx and Local MySQL install not found

hi, my host have installed nginx and mysql,how to config nginx and mysql directory?

ghost@VM-34-185-ubuntu:/home/siteList/blog.ghost$ ghost install
� Checking system Node.js version
� Checking current folder permissions
System checks failed with message: 'Missing package(s): nginx'
Some features of Ghost-CLI may not work without additional configuration.
For local installs we recommend using `ghost install local` instead.
? Continue anyway? Yes
� Checking operating system
Local MySQL install not found. You can ignore this if you are using a remote MySQL host.
Alternatively you could:
a) install MySQL locally
b) run `ghost install --db=sqlite3` to use sqlite
c) run `ghost install local` to get a development install using sqlite3.
? Continue anyway? No
� Checking MySQL is installed
A SystemError occurred.

Message: MySQL check failed.

ghost@VM-34-185-ubuntu:/home/siteList/blog.ghost$ ghost install --no-stack
✔ Checking system Node.js version
✔ Checking current folder permissions
ℹ Checking operating system [skipped]
Local MySQL install not found. You can ignore this if you are using a remote MySQL host.
Alternatively you could:
a) install MySQL locally
b) run `ghost install --db=sqlite3` to use sqlite
c) run `ghost install local` to get a development install using sqlite3.
? Continue anyway? No
✖ Checking MySQL is installed
A SystemError occurred.

Message: MySQL check failed.

Debug Information:
    Node Version: v6.11.2
    Ghost-CLI Version: 1.1.1
    Environment: production
    Command: 'ghost install --no-stack'

Please refer to https://docs.ghost.org/v1/docs/troubleshooting#section-cli-errors for troubleshooting.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 77 (14 by maintainers)

Most upvoted comments

I’ve been searching for solution and wondering if this issue is fix?

Probably not, or at least what do I know.

See my comment above if you’re ok with patching the code yourself.

I’m not really sure how to patch it, I hoped in Ghost to be easy to set up, not something I have to patch myself. I will probably look for some alternative, as this becomes too complicated to have it stable and updated

For KodzghlyCZ and anyone else trying to figure this out, the file that needs to be edited is https://github.com/TryGhost/Ghost-CLI/blob/main/extensions/nginx/index.js, which, if you’re using Ubuntu, is likely to be found at /usr/lib/node_modules/ghost-cli/extensions/nginx/index.js (remember you’ll need to use su/sudo to edit), and the portion to be edited is at the very bottom of the file (at least at the time of writing).

You’ll want to change this: async isSupported() { try { const services = await sysinfo.services('*'); return services.some(s => s.name === nginxProgramName); } catch (error) { return false; } }

to this:

async isSupported() { try { const services = await sysinfo.services('*'); return services.some(s => s.name.trim() === nginxProgramName); } catch (error) { return false; } }

This just worked for me minutes ago. Will submit a PR.

For now, nginx is detected by dpkg, so ghost setup nginx can only work normally on Ubuntu and Debian. I think these detections should be independent of operating system.

I had the same error. Edited the files as @KodzghlyCZ described.

At first, it did not work. After reinstalling Ghost with ghost uninstall, ghost setup found NGINX successfully.

OS: Ubuntu 22.04 LTS NGINX: 1.18.0 MySQL: ver 8.0.29-0ubuntu0.22.04.2 Ghost-CLI version: 1.21.0 Ghost version: 5.2.3

Thanks again @sebhildebrandt 🙂

To everyone else, please update to Ghost-CLI 1.21.1. Official support for Ubuntu 22.04 in Ghost-CLI will be coming soon 🙂

I’ve been searching for solution and wondering if this issue is fix?

Probably not, or at least what do I know.

See my comment above if you’re ok with patching the code yourself.

I’m not really sure how to patch it, I hoped in Ghost to be easy to set up, not something I have to patch myself. I will probably look for some alternative, as this becomes too complicated to have it stable and updated

For KodzghlyCZ and anyone else trying to figure this out, the file that needs to be edited is https://github.com/TryGhost/Ghost-CLI/blob/main/extensions/nginx/index.js, which, if you’re using Ubuntu, is likely to be found at /usr/lib/node_modules/ghost-cli/extensions/nginx/index.js (remember you’ll need to use su/sudo to edit), and the portion to be edited is at the very bottom of the file (at least at the time of writing).

You’ll want to change this: async isSupported() { try { const services = await sysinfo.services('*'); return services.some(s => s.name === nginxProgramName); } catch (error) { return false; } }

to this:

async isSupported() { try { const services = await sysinfo.services('*'); return services.some(s => s.name.trim() === nginxProgramName); } catch (error) { return false; } }

This just worked for me minutes ago. Will submit a PR.

Thanks, I would probably just wait for the change to be merged, since now I’m running Hugo on my web and don’t need to change to Ghost immediately. Still it would be nice if your PR gets accepted, fingers crossed

The problem has not solved so I think closing of the topic is not good idea my lovely bot. Thank you so much for every contributers

Our bot has automatically marked this issue as stale because there has not been any activity here in some time. The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR. We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂

For me, ghost was able to detect mysql without dpkg, but not nginx

Testing and research required to find out how we can detect that nginx/mysql is installed e.g. use which. Currently we are using dpkg, which turned out is not a generic approach.

@aswordok couple of things:

  1. Could you post the contents of /root/.ghost/logs/ghost-cli-debug-2017-09-14T06_21_28_654Z.log? It should have some more information as to what exactly is going wrong.
  2. The reason it is which mysqld as opposed to which mysql is the fact that the mysql command is for the mysql client, which allows you to access and run commands on mysql databases. The mysqld command, however, is the actual mysql server command (or at least it is on Ubuntu, I guess it’s different on CentOS).

@klpek the reason I asked for the output of which mysqld and which nginx was not to get the versions - I’m looking for where the actual mysql/nginx executables are installed on the system - which mysqld and which nginx are the commands the CLI uses to determine whether or not mysql/nginx is installed at the moment.