# Ghost Error Occurred - Knex? Sqlite?

**URL:** <https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669>\
**Category:** Developer help\
**Created:** [May 26, 2020, 5:11am UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669 "2020-05-26T05:11:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonmc](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/simonmc/32/3579_2.png) [@simonmc](https://forum.ghost.org/u/simonmc)\
**Post date:** [May 26, 2020, 5:11am UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/1 "2020-05-26T05:11:05Z")

</div>

Not sure what has changed with my **local setup** , but all three of my Ghost local installs have stopped working and I’m really struggling to get them back up and running.

**ghost doctor** - No errors for all installs.

This is the error I get when trying to run ‘ghost start’

```auto
    OS: Mac OS X, v10.15.4
    Node Version: v12.16.3
    Ghost Version: 3.12.1
    Ghost-CLI Version: 1.14.0
    Environment: development
    Command: 'ghost start'
Message: 
/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/client.js:225
      throw new Error(`${message}\n${e.message}`);
      ^

Error: Knex: run
$ npm install sqlite3 --save
Cannot find module '/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node'
Require stack:
- /Users/simon/Work/_Discover_/versions/3.12.1/node_modules/sqlite3/lib/sqlite3.js
- /Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/dialects/sqlite3/index.js
- /Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/knex.js
- /Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/index.js
- /Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/knex.js
- /Users/simon/Work/_Discover_/versions/3.12.1/core/server/data/db/connection.js
- /Users/simon/Work/_Discover_/versions/3.12.1/core/server/index.js
- /Users/simon/Work/_Discover_/versions/3.12.1/core/index.js
- /Users/simon/Work/_Discover_/versions/3.12.1/index.js
    at Client_SQLite3.initializeDriver (/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/client.js:225:13)
    at Client_SQLite3.Client (/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/client.js:59:10)
    at new Client_SQLite3 (/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/dialects/sqlite3/index.js:18:10)
    at Knex (/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/knex.js:52:28)
    at Object.<anonymous> (/Users/simon/Work/_Discover_/versions/3.12.1/core/server/data/db/connection.js:33:20)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at isDatabaseInitialisationRequired (/Users/simon/Work/_Discover_/versions/3.12.1/core/server/index.js:164:16)
    at makeGhost (/Users/simon/Work/_Discover_/versions/3.12.1/core/index.js:13:12)
    at Object.<anonymous> (/Users/simon/Work/_Discover_/versions/3.12.1/index.js:23:1)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47

Stack: Error: 
/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/client.js:225
      throw new Error(`${message}\n${e.message}`);
      ^

Error: Knex: run
$ npm install sqlite3 --save
Cannot find module '/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node'
Require stack:
- /Users/simon/Work/_Discover_/versions/3.12.1/node_modules/sqlite3/lib/sqlite3.js
- /Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/dialects/sqlite3/index.js
- /Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/knex.js
- /Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/index.js
- /Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/knex.js
- /Users/simon/Work/_Discover_/versions/3.12.1/core/server/data/db/connection.js
- /Users/simon/Work/_Discover_/versions/3.12.1/core/server/index.js
- /Users/simon/Work/_Discover_/versions/3.12.1/core/index.js
- /Users/simon/Work/_Discover_/versions/3.12.1/index.js
    at Client_SQLite3.initializeDriver (/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/client.js:225:13)
    at Client_SQLite3.Client (/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/client.js:59:10)
    at new Client_SQLite3 (/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/dialects/sqlite3/index.js:18:10)
    at Knex (/Users/simon/Work/_Discover_/versions/3.12.1/node_modules/knex/lib/knex.js:52:28)
    at Object.<anonymous> (/Users/simon/Work/_Discover_/versions/3.12.1/core/server/data/db/connection.js:33:20)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at isDatabaseInitialisationRequired (/Users/simon/Work/_Discover_/versions/3.12.1/core/server/index.js:164:16)
    at makeGhost (/Users/simon/Work/_Discover_/versions/3.12.1/core/index.js:13:12)
    at Object.<anonymous> (/Users/simon/Work/_Discover_/versions/3.12.1/index.js:23:1)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47

    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/ghost-cli/lib/utils/local-process.js:65:35)
    at ChildProcess.emit (events.js:310:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

```

### Any advice for debugging would be greatly appreciated

I have installed a new local installation using the following code and it all works fine so not sure why all the old ones are busted?:

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [May 26, 2020, 5:26am UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/2 "2020-05-26T05:26:13Z")

</div>

Hey @simonmc

Thanks for posting the debug info! It looks like Ghost is having trouble finding the sqlite library to interact with your database. Can you try running `ghost buster` to clear the module cache, and then `ghost update 3.12.1 --force` to reinstall this version of ghost?

---

<div class="post-metadata">

**Author:** ![simonmc](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/simonmc/32/3579_2.png) [@simonmc](https://forum.ghost.org/u/simonmc)\
**Post date:** [May 26, 2020, 5:59am UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/3 "2020-05-26T05:59:02Z")

</div>

You are a legend @vikaspotluri123 ! Thanks.  
The ghost update worked a treat on all installs.

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [May 26, 2020, 11:24am UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/4 "2020-05-26T11:24:18Z")

</div>

@simonmc did you upgrade your Node.js version? If you do that, you have to run the commands @vikaspotluri123 gave you afterwards.

Ghost uses binary modules compiled against the node version, so if you upgrade node they need to be reinstalled.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [May 26, 2020, 4:27pm UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/5 "2020-05-26T16:27:23Z")

</div>

The CLI should detect if the node version changes and prompt you to fix it - here’s the error it will output:

![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/b1668029d28576bc6f28a5343a26a0e121896ad8.png)

---

<div class="post-metadata">

**Author:** ![simonmc](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/simonmc/32/3579_2.png) [@simonmc](https://forum.ghost.org/u/simonmc)\
**Post date:** [May 26, 2020, 11:22pm UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/6 "2020-05-26T23:22:30Z")

</div>

That was exactly what I’d done. Thanks for the tip!

---

<div class="post-metadata">

**Author:** ![simonmc](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/simonmc/32/3579_2.png) [@simonmc](https://forum.ghost.org/u/simonmc)\
**Post date:** [May 26, 2020, 11:23pm UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/7 "2020-05-26T23:23:22Z")

</div>

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [May 27, 2020, 7:28am UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/8 "2020-05-27T07:28:47Z")

</div>

Hey @simonmc if you have a moment could you share the exact details of how you have Node installed and how you updated Node?

Ghost-CLI should give you a specific error if the binary dependencies need reinstalling, as shown above so we’d love to create a full reproduction case to get this fixed.

Your help would make it possible for us to fix this right away.

Thanks!

---

<div class="post-metadata">

**Author:** ![Praveen\_Angyan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/praveen_angyan/32/10238_2.png) [@Praveen\_Angyan](https://forum.ghost.org/u/Praveen_Angyan)\
**Post date:** [November 8, 2020, 8:31am UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/9 "2020-11-08T08:31:35Z")

</div>

I had the same issue. Basically I installed ghost-cli, it warned me that my node version was not supported. I upgraded node and then got this same error. I did not receive a warning that the binaries needed to be upgraded.

I think this was the only troubleshooting step I had to take in what was otherwise a very smooth installation.

---

<div class="post-metadata">

**Author:** ![Praveen\_Angyan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/praveen_angyan/32/10238_2.png) [@Praveen\_Angyan](https://forum.ghost.org/u/Praveen_Angyan)\
**Post date:** [November 11, 2020, 12:52am UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/10 "2020-11-11T00:52:23Z")

</div>

1. I installed a brand new Ubuntu (20.02) installation using WSL 2 for Windows.
2. I installed node:  
curl -sL [https://deb.nodesource.com/setup\_15.x](https://deb.nodesource.com/setup_15.x) | sudo -E bash -  
sudo apt-get install -y nodejs
3. Then I installed Ghost CLI:  
npm install ghost-cli@latest -g
4. Then I tried to install Ghost:  
ghost install local
5. I got an error that node 15.x is not supported
6. I installed nvm next  
curl -o- [https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh](https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh) | bash
7. I installed node v14.15.0  
nvm install 14.15.0
8. I then tried to install ghost again  
ghost install local

That’s when I got the crash message. There was no mention of binaries.

 ![screenshot](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/f/f734ccf4f25d4dde15269bdfac76e3e6cb630b38.png)  
9. I had to run **npm install sqlite3 --save** and then everything worked.

---

<div class="post-metadata">

**Author:** ![whollacsek](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/whollacsek/32/9675_2.png) [@whollacsek](https://forum.ghost.org/u/whollacsek)\
**Post date:** [November 24, 2020, 12:01pm UTC](https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669/11 "2020-11-24T12:01:18Z")

</div>

I have the same issue with the same steps as you
