MacOS/Homebrew Lost Ghost-cli

All was well until I upgraded MacOS to 12.3 (Monterey) on my Macbook Air M1. Lost ghost and after backing node version to 14.7, could not run ghost start development without error:

paul@MacBookAirM1 my_ghost % ghost start development
Found a development config but not a production config, running in development mode instead

:heavy_check_mark: Checking system Node.js version - found v14.19.1
:heavy_check_mark: Checking current folder permissions
:heavy_check_mark: Validating config
:heavy_check_mark: Checking memory availability
:heavy_check_mark: Checking binary dependencies
:heavy_multiplication_x: Starting Ghost: ghost-local
A GhostError occurred.

Message: Ghost was able to start, but errored during boot with: Knex: run
$ npm install sqlite3 --save
Cannot find module ‘/Users/paul/my_ghost/versions/4.41.3/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node’
Require stack:

  • /Users/paul/my_ghost/versions/4.41.3/node_modules/sqlite3/lib/sqlite3-binding.js
  • /Users/paul/my_ghost/versions/4.41.3/node_modules/sqlite3/lib/sqlite3.js
  • /Users/paul/my_ghost/versions/4.41.3/node_modules/knex/lib/dialects/sqlite3/index.js
  • /Users/paul/my_ghost/versions/4.41.3/node_modules/knex/lib/config-resolver.js
  • /Users/paul/my_ghost/versions/4.41.3/node_modules/knex/lib/knex.js
  • /Users/paul/my_ghost/versions/4.41.3/node_modules/knex/lib/index.js
  • /Users/paul/my_ghost/versions/4.41.3/node_modules/knex/knex.js
  • /Users/paul/my_ghost/versions/4.41.3/node_modules/knex-migrator/lib/database.js
  • /Users/paul/my_ghost/versions/4.41.3/node_modules/knex-migrator/lib/index.js
  • /Users/paul/my_ghost/versions/4.41.3/core/server/data/db/state-manager.js
  • /Users/paul/my_ghost/versions/4.41.3/core/boot.js
  • /Users/paul/my_ghost/versions/4.41.3/ghost.js
  • /Users/paul/my_ghost/versions/4.41.3/index.js

Debug Information:
OS: macOS, v12.3
Node Version: v14.19.1
Ghost Version: 4.41.3
Ghost-CLI Version: 1.19.2
Environment: development
Command: ‘ghost start development’

Additional log info available in: /Users/paul/.ghost/logs/ghost-cli-debug-2022-04-01T13_56_00_288Z.log

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

You can always refer to Ghost-CLI - A fully loaded tool for installation and configuration for troubleshooting.
paul@MacBookAirM1 my_ghost %

Any suggestions to fix this error … I’ve tried uninstalling and reinstalling ghost-cli

Hey @zed4! :slightly_smiling_face: Would you be able to try with Ghost 4.42.0 (released yesterday)?

MacOS 12.3 removed Python 2, which broke the build for sqlite3, so we’ve had to switch to @vscode/sqlite3. I’m using an M1 w/ MacOS 12.3 and Node 16.14.2, and can confirm it definitely builds locally for me now :slightly_smiling_face:

1 Like

Most definitely … I was wondering if it was something like that and was seriously considering going back to MacOS 12.0.1. I’ll try it out.

Something else to check in case that’s not working - make sure you’re using the Apple Silicon build of Node. I’ve seen some weird issues with Rosetta. You can check which version you have by doing file $(which node) and it should say arm64 on the end :slightly_smiling_face:

Installed node 16.14.2 and checked and confirmed arm64 node build, but now I cannot get ghost-cli installed without lots of errors using node 16.14.2 . If I back off to node 14.19.1, then ghost-cli installs ok, BUT node is x86_64 … assume that means its using Rosetta and not native. Now I can partially install ghost except sqlite3 fails. Do I need to install from source instead of using ghost-cli? Or is there a way to force later ghost version using ghost-cli?

******* Success ******** :smiley:

@zed4 Great! What else did you have to do to fix it? :slightly_smiling_face: