Ghost local installation fail because of SQlite3

Clean install.

Debug Information:
OS: LinuxMint, v20.1
Node Version: v14.19.1
Ghost Version: 4.42.0
Ghost-CLI Version: 1.19.2
Environment: development
Command: ‘ghost start’
npm -v 6.14.16
nvm --version 0.34.0

I downgraded to node 14 from 16 to try. again a fresh install.

I searched forums and github and tried all solutions I could find including

uninstall and reinstall ghost-cli, even verified all folders were removed, verified its in a user directory and not root.

tried npm install sqlite3 --save
tried npm install sqlite3 --build-from-source

I tried windows a few times and it failed for same reason as below.

  • What errors or information do you see in the console?

/ghost demo $ ghost start
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.

:heavy_check_mark: Checking system Node.js version - found v14.19.1
:information_source: Ensuring user is not logged in as ghost user [skipped]
:information_source: Checking if logged in user is directory owner [skipped]
: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 ‘@vscode/sqlite3’
Require stack:

  • /ghost demo/versions/4.42.0/node_modules/knex/lib/dialects/sqlite3/index.js
  • /ghost demo/versions/4.42.0/node_modules/knex/lib/knex-builder/internal/config-resolver.js
  • /ghost demo/versions/4.42.0/node_modules/knex/lib/knex-builder/Knex.js
  • /ghost demo/versions/4.42.0/node_modules/knex/lib/index.js
  • /ghost demo/versions/4.42.0/node_modules/knex/knex.js
  • /ghost demo/versions/4.42.0/node_modules/knex-migrator/lib/database.js
  • /ghost demo/versions/4.42.0/node_modules/knex-migrator/lib/index.js
  • /ghost demo/versions/4.42.0/core/server/data/db/state-manager.js
  • /ghost demo/versions/4.42.0/core/boot.js
  • /ghost demo/versions/4.42.0/ghost.js
  • /ghost demo/versions/4.42.0/index.js

The only thing in the debug log was the above repeated with this tacked on at the end

at ChildProcess.(/home/myusername/.nvm/versions/node/v14.19.1/lib/node_modules/ghost-cli/lib/utils/local-process.js:75:35)
at ChildProcess.emit (events.js:400:28)
at emit (internal/child_process.js:912:12)
at processTicksAndRejections (internal/process/task_queues.js:83:21)

Further more, I see this when trying to install sqlite3

$ npm install sqlite3 --save

sqlite3@5.0.2 install /ghost demo/node_modules/sqlite3
node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
[sqlite3] Success: “/ghost demo/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node” is installed via remote
npm WARN saveError ENOENT: no such file or directory, open ‘/ghost demo/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/ghost demo/package.json’
npm WARN ghost demo No description
npm WARN ghost demo No repository field.
npm WARN ghost demo No README data
npm WARN ghost demo No license field.

  • sqlite3@5.0.2
    updated 1 package and audited 191 packages in 1.905s

3 packages are looking for funding
run npm fund for details

found 15 high severity vulnerabilities
run npm audit fix to fix them, or npm audit for details

  • What steps could someone else take to reproduce the issue you’re having?

Apparently install on windows or linux in this order. NPM, NVM, NODE, GHOST-CLI, GHOST

I am at a loss here. I searched high and low but something tells me I missed some thread that solves this.

Please help.

Cheers
Joe

edit: I must be doing something wrong. I put a fresh install of Ubuntu 20.4, installed node with apt and adding it to repository. Installed ghost.cli and then ghost. It failed. same as before. Is there some kind of update thats broken something?

Hey @Joecool! :slightly_smiling_face:

We recently had to switch our SQLite dependency to @vscode/sqlite3, and it may have trouble compiling on some setups. Unfortunately, knex reports the missing dependency is sqlite3, but this is a bug fixed in an unreleased version.

You may need to install a C++ compiler so @vscode/sqlite3 can compile. On Ubuntu you can use apt install build-essential, I’m not sure about Linux Mint. You should be able to run ghost update --force to re-install Ghost with its dependencies.

2 Likes

Thanks. Instant success following your “1 weird trick” to enhancing my performance.

Mint is just a more fleshed out Ubuntu. I use it mainly because it comes with several different LTS desktops to choose from and a Deb style rolling release. Oh and no snap. Its everything Ubuntu should have been.

1 Like

I’ve got the same issue:

OS: Mac OS X, v10.13.6
Node Version: v14.18.1
Ghost Version: 4.43.0
Ghost-CLI Version: 1.19.2
Environment: development
Command: ‘ghost install local’

None of that is working for me. A lot of people still run perfectly good older machines. Any idea what a solution might be?

This solution solved it for me so that it might help you as well.

Hey all - we were forced to switch to a fork because one of our dependencies removed support for node-sqlite3, as the project was becoming unmaintained. Since then, the Ghost core team have taken over maintainership of the original SQLite dependency and we’ve been fixing up the build issues.

I’m still waiting on Knex to switch back to the original version, but I hope that is happening soon and we can then ship this in Ghost. Watch this space :slightly_smiling_face:

1 Like

After playing around with this today, this bug seems to be related to paths with spaces.

On my system, a fresh ghost install to a subdirectory of a path without spaces succeeded every time, while installs to subdirectories on path with spaces failed with the same sqlite3 error every time.

If you’re still having issues, check your install path.

It’s working fine on 4.45.0 - thanks for all the suggestions anyway, guys.

2 Likes