Can't start Ghost locally - cannot find module 'sqlite3'

Hi, I’d really appreciate help with this error. I’m trying to run Ghost locally to do some Theme development. But Ghost won’t run.

I have the following:

OS: macOS, v12.3.1
Node Version: v16.15.1
Ghost Version: 5.2.4
Ghost-CLI Version: 1.21.0
Environment: development
Command: ‘ghost start’


I'm getting the dreaded error:

:heavy_check_mark: Checking system Node.js version - found v16.15.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 ‘sqlite3’


I have seen others with this issue but the solutions seem one-off or version-specific.

I appear to have sqlite3:

SQLite version 3.35.4 2021-04-02 15:20:15

I am running this on an M1 chip and I’ve seen issues with NodeJS however I’m running a version that is compatible with Apple M1 (v16+).

Is there a solution?

Thank you!

I’ve looked at other threads with similar issues, for example, this one.

Those solutions don’t seem to work here.

There are no dependency errors… it just seems that Ghost can’t find sqlite3 for some reason.

I just ran ghost update —force again just in case

It had no problems:

This is the full log file (not different from the errors posted above in the original post):

@Hannah and @vikaspotluri123 if you have any suggestions I’d appreciate it, thanks.

Update: I copied the sqlite3 executable into my Ghost installations node_modules folder.

Now instead of the “cannot find module ‘sqlite3’” error, on ghost start the error I’m getting is

Message: Ghost was able to start, but errored during boot with: Knex: run
$ npm install sqlite3 —save
Invalid or unexpected token

:frowning:

Does anyone know where Ghost expects the sqlite3 executable to be, so that I can copy it there?

Try running “npm install sqlite3 —save” manually. It worked for me.