HELP! I cannot make Ghost work after ghost install local.
I have reinstalled nvm, nodejs, npm, the chalk module etc. and reconfigured everything if I missed something, but still cannot figure out the solution.
(A had an older version of Ghost working on the same system, I just gave it another try and restarted with installing the current version.)
after ghost start I got:
Running in development mode
✔ Checking system Node.js version - found v18.18.2
ℹ Ensuring user is not logged in as ghost user [skipped]
ℹ Checking if logged in user is directory owner [skipped]
✔ Checking current folder permissions
✔ Validating config
✔ Checking memory availability
✔ Checking binary dependencies
✖ Starting Ghost: ghost-local
A GhostError occurred.
Message:
node:internal/modules/cjs/loader:1080
throw err;
^
Error: Cannot find module 'chalk'
Require stack:
- /home/path/to/my/ghost/project/versions/5.72.1/node_modules/@tryghost/pretty-cli/lib/styles.js
- /home/path/to/my/ghost/project/versions/5.72.1/node_modules/@tryghost/pretty-cli/lib/pretty-cli.js
- /home/path/to/my/ghost/project/versions/5.72.1/node_modules/@tryghost/pretty-cli/index.js
- /home/path/to/my/ghost/project/versions/5.72.1/core/cli/command.js
- /home/path/to/my/ghost/project/versions/5.72.1/ghost.js
- /home/path/to/my/ghost/project/versions/5.72.1/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/home/path/to/my/ghost/project/versions/5.72.1/node_modules/@tryghost/pretty-cli/lib/styles.js:1:15)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/path/to/my/ghost/project/versions/5.72.1/node_modules/@tryghost/pretty-cli/lib/styles.js',
'/home/path/to/my/ghost/project/versions/5.72.1/node_modules/@tryghost/pretty-cli/lib/pretty-cli.js',
'/home/path/to/my/ghost/project/versions/5.72.1/node_modules/@tryghost/pretty-cli/index.js',
'/home/path/to/my/ghost/project/versions/5.72.1/core/cli/command.js',
'/home/path/to/my/ghost/project/versions/5.72.1/ghost.js',
'/home/path/to/my/ghost/project/versions/5.72.1/index.js'
]
}
Node.js v18.18.2
Debug Information:
OS: Ubuntu, v22.04.3 LTS
Node Version: v18.18.2
Ghost Version: 5.72.1
Ghost-CLI Version: 1.25.3
Environment: development
Command: 'ghost start'
Additional log info available in: /home/aaao/.ghost/logs/ghost-cli-debug-2023-11-08T18_01_50_131Z.log
Try running ghost doctor to check your system for known issues.
.```
BTW, I read on https://ghost.org/docs/install/local/ that
* The SQLite3 database is auto-setup and located in `/content/data/`
but the folder is empty.
Without knowing how your system is set up, it’s difficult to diagnose the issue. However, you might have installed Node twice. Since you’re using Ubuntu, I’d avoid nvm and install from the official Node repository using APT.
Using APT and nvm at the same time may have caused the issue. I’d remove Node completely, and then reinstall, using APT and the official repository. This method has never let me down, and upgrading Node versions is a breeze (as required by recent updates to Ghost.)
I deleted nvm and all nodejs versions and reinstalled Node with apt, so now:
nodejs -v
v18.18.2
npm -v
9.8.1
After sudo npm install ghost-cli@latest -g or npm i ghost-cli ghost --version
Ghost-CLI version: 1.23.0
(but isn’t the latest version is 1.25.3?)
Then after ghost install local
I got the following error:
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 v18.18.2
✔ 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
Installed: 18.18.2
See https://ghost.org/docs/faq/node-versions/ for more information
Debug Information:
OS: Ubuntu, v22.04.3 LTS
Node Version: v18.18.2
Ghost-CLI Version: 1.23.0
Environment: development
Command: 'ghost install local'
Ghost’s current recommended Node version is Node v18 LTS.
Version Support Level
17.x and below Unsupported
18.x (Node v18 Hydrogen LTS) Recommended
19.x and above Unsupported
I suspect your environment needs some tidying up to remove all traces of Node. Indeed, I just did a local installation on Ubuntu 23.10 and it worked fine.
Hi again… and thanks!
I upgraded Ubuntu to 23.04 first, which did not solve the problem (of messed up node versions and packages), but
after I reinstalled Ubuntu 22.04, the official instructions you advised for installing Ghost worked. Thanks again!