Running ghost via cli locally

I am trying to install and run ghost locally, but end up in this infinite loop of sorts. I’m on Windows 11 and running the commands on an Administrator Terminal.

I install the latest ghost-cli:

PS D:\ghost-dev> npm install -g ghost-cli@latestnpm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

changed 634 packages in 24s

Then I try to install ghost locally but needs a higher node version:

PS D:\ghost-dev> ghost install local

Love open source? We’re hiring JavaScript Engineers to work on Ghost full-time.
https://careers.ghost.org

Running in development mode

You are running an outdated version of Ghost-CLI.
It is recommended that you upgrade before continuing.
Run `npm install -g ghost-cli@latest` to upgrade.


√ Checking system Node.js version - found v20.11.1
√ Checking current folder permissions
√ Checking memory availability
√ Checking free space
√ Checking for latest Ghost version
√ Setting up install directory
× Downloading and installing Ghost v6.0.3
A SystemError occurred.

Message: Ghost v6.0.3 is not compatible with the current Node version. Your node version is 20.11.1, but Ghost v6.0.3 requires ^22.13.1

Debug Information:
    OS: Microsoft Windows 11 Pro, v10.0.26100
    Node Version: v20.11.1
    Ghost-CLI Version: 1.26.1
    Environment: development
    Command: 'ghost install local'

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

So I change my node version

PS D:\ghost-dev> nvm use 22.13.1
Now using node v22.13.1 (64-bit)

And try to install ghost again

PS D:\ghost-dev> ghost install local

Running in development mode

You are running an outdated version of Ghost-CLI.
It is recommended that you upgrade before continuing.
Run `npm install -g ghost-cli@latest` to upgrade.

× Checking system Node.js version - found v22.13.1
(node:30896) \[DEP0040\] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
√ Checking current folder permissions
√ Checking memory availability
√ Checking free space
One or more errors occurred.

1. Checking system Node.js version

Message: The version of Node.js you are using is not supported.
Supported: ^12.22.1 || ^14.17.0 || ^16.13.0 || ^18.0.0 || ^20.11.1
Installed: 22.13.1
See https://ghost.org/docs/faq/node-versions/ for more information

Debug Information:
OS: Microsoft Windows 11 Pro, v10.0.26100
Node Version: v22.13.1
Ghost-CLI Version: 1.26.1
Environment: development
Command: ‘ghost install local’

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

Now it says I need the older version of npm? What’s the actual version I need to use?

What do I need to do to run this locally?

It looks like you don’t have the latest version of the CLI installed - 1.28.3 is available, but you’re on 1.26.1 This can happen for several reasons, one potential reason is that you installed the CLI using a different package manager, like yarn or pnpm.

As an aside, if you can, install Ghost using WSL - there’s a lot more people that use Linux to run Ghost over Windows, so Windows sometimes has some broken features.

How can I install the latest CLI on Windows? I tried npm install -g ghost-cli@latest and it doesn’t seem to have worked?

My first thought is you have multiple versions of the CLI installed.

Is there a way to uninstall everything and start from scratch?

If you don’t know how the CLI was installed, it’s kind of hard to figure out what to uninstall :slight_smile: