Cannot install Ghost due to SQlite3 error

I’m trying to install Ghost but I keep running into a SQlite3 error. Any idea how I could fix this?

I tried following the solution marked in a past thread. Not sure if I performed it correctly or not but it’s not working for me.

Found a development config but not a production config, running in development mode instead

Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js

✔ Checking system Node.js version - found v16.14.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: Ghost was able to start, but errored during boot with: Knex: run
$ npm install @vscode/sqlite3 --save
Cannot find module '@vscode/sqlite3'
Require stack:
- /home/cabox/workspace/Ghost/versions/4.44.0/node_modules/knex-migrator/node_modules/knex/lib/dialects/sqlite3/index.js
- /home/cabox/workspace/Ghost/versions/4.44.0/node_modules/knex-migrator/node_modules/knex/lib/knex-builder/internal/config-resolver.js
- /home/cabox/workspace/Ghost/versions/4.44.0/node_modules/knex-migrator/node_modules/knex/lib/knex-builder/Knex.js
- /home/cabox/workspace/Ghost/versions/4.44.0/node_modules/knex-migrator/node_modules/knex/lib/index.js
- /home/cabox/workspace/Ghost/versions/4.44.0/node_modules/knex-migrator/node_modules/knex/knex.js
- /home/cabox/workspace/Ghost/versions/4.44.0/node_modules/knex-migrator/lib/database.js
- /home/cabox/workspace/Ghost/versions/4.44.0/node_modules/knex-migrator/lib/index.js
- /home/cabox/workspace/Ghost/versions/4.44.0/core/server/data/db/state-manager.js
- /home/cabox/workspace/Ghost/versions/4.44.0/core/boot.js
- /home/cabox/workspace/Ghost/versions/4.44.0/ghost.js
- /home/cabox/workspace/Ghost/versions/4.44.0/index.js

Debug Information:
    OS: Ubuntu, v16.04 LTS
    Node Version: v16.14.2
    Ghost Version: 4.44.0
    Ghost-CLI Version: 1.19.2
    Environment: development
    Command: 'ghost start'

Additional log info available in: /home/cabox/.ghost/logs/ghost-cli-debug-2022-04-19T17_57_58_733Z.log

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

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

Having same issue after upgrade to 4.44.0. I’ve likely missed a few interim versions, as it’s been a few weeks since I’ve run my local.

Also tried ghost buster and force update with no success.

I managed to get it working, here’s a step-by-step of what I had to do:

  1. Install sqlite3 separately
    npm install sqlite3 --save

  2. Move sqlite3 into node_modules/@vscode
    (I moved into every node_module folder that existed in my Ghost install)

  3. sudo apt install build-essential

  4. ghost update --force

  5. And finally ghost start

It’s not the cleanest or most ideal, but I got it running on a local/dev environment at least :smiley:

I’m on MacOS, so no apt, but I’ve got xcode dev tools installed. I’ve been playing around with it this morning without success… Hopefully someone on the Ghost team can shed some light for us.

For step 3, try replacing it with xcode-select --install

Source: Stackoverflow build-essential alternative

Hopefully, it works!

I already have xcode dev tools installed, so xcode-select --install doesn’t do anything.

I didn’t copy sqlite3 into every node_modules subdirectory (there are hundreds), but just the main for ghost 4.44.0, and inside there to the knex, knex-migration, and knex-migration/knex node_modules subdirs, since the error appears to be specifically related to knex.

Again, no luck.

Based on additional testing today, I was thinking this is a bug related to paths with spaces, however, looking at the debug output it seems @Raz1 was not using such a path, so now I’m second-guessing.

Still, if you’re having issues despite the above recommended solutions, trying a fresh install to a path with no spaces might be worth a shot.