What To Do If SQLite3 Does Not Compile

Ghost, by default, relies on SQLite3 for storing all content. When installing Ghost with npm install --production, npm looks through the package.json file included with Ghost to see what needs to be installed. In the package.json file, SQLite3 is listed as a dependency. The group behind SQLite3 has pre built the SQLite3 binary on many popular architectures so that it does not have to be compiled during the Ghost install. During our tests on CentOS, Ubuntu, Mac OS X, and Windows we have found that there is a pre built binary.

If you are installing Ghost and see a message that the SQLite3 binary could "not found, falling back to source compile", you are attempting to install Ghost on a computer that the SQLite3 team has not precompiled the source code for. The full error message that you will see will look like this:

[sqlite3]: Checking for node-sqlite3.s3.amazonaws.com/Release/node_sqlite3-v2.1.a-node-v11-linux-arm.tar.gz [sqlite3]: node-sqlite3.s3.amazonaws.com/Release/node_sqlite3-v2.1.a-node-v11-linux-arm.tar.gz not found, falling back to source compile (Error: Server returned 404) Build failed [sqlite3]: 1 npm ERR! weird error 1 npm ERR! tar pack Error reading /root/tmp/npm-6929-HJERE1J/1306209/package npm ERR! not ok code 0

The Quick Fix

To not have to wait for the SQLite3 team to build a binary for your environment, you can force SQLite3 to compile. To do that run sqlite3 --build-from-source. You will need tools installed in your operating system for compiling software like gcc before being able to run sqlite3 --build-from-source.

I would suggest letting the SQLite3 team know by following their instructions here. They will want to know details about what operating system, hardware architecture, version of Node.js etc.