Ghost local install on Mac M1 - Cannot find module 'sqlite3'

Hey All,

I am new to Ghost and am trying to set up a local install to play with it. I am on a Mac M1 mini and cannot get Ghost to start after installation. I get an error " cannot find module ‘sqlite3’.

I have node 16.14 installed and npm 8.3.1. I have tried to install sqlite3 using ‘npm install --save sqlite3’ in the Ghost folder, but it always fails. I checked using which sqlite3, and it is installed on my mac already.

  • What’s your URL? Localhost
  • What version of Ghost are you using? 4.38.0
  • What configuration? Local Install
  • What browser? Firefox
  • What errors or information do you see in the console?

"Message: Ghost was able to start, but errored during boot with: Knex: run
$ npm install sqlite3 --save
Cannot find module ‘sqlite3’"

I have tried installing Ghost, NPM, Node etc. and re-installing and nothing works. I have also tried Node v 12 and 14 listed on the install page, but neither works. I also tried a ghost update version 4.38.0 --force which completes but still the same outcome.

I’m not sure what to do? I set up a dummy install on a DO server using their Ghost image, and it works fine, but I’d rather host locally whilst I look around.

Any ideas?


This may be related to your issue ( Can't get ghost running on Apple M1 chip! )?

My ghost issue isn’t the same as that thread. My ghost is able to start but the error occurs with sqlite3.

Ghost doctor returns no issues.

I am using Node 16.14.0 which has support for the M1 chips and is the recommended version according to the Ghost local install page.

I’m not sure what else is required to make it work if M1 chips are supported in the version of Node?

I do have M1, and Ghost is working fine. My Node and NPM versions.

➜  ~ node -v
➜  ~ npm -v
➜  ~

Check this GitHub issue with the same error, try the suggested solutions, and if not, maybe raise a new Issue, or someone here might help.

Thanks for the info. How did you install Node and NPM? Did you do it normally, or did you use the Rosetta method?

I tried the methods on the GitHub page but no difference, still the same issue.

Yes, I used the Rosetta method.

That worked! I had to completely remove Node and NPM and then install both using Rosetta.

I then installed Ghost CLI and Ghost in Rosetta mode and it works like a charm!

Thanks so much everyone!

1 Like

Just a quick update. Everything worked until I re-booted my computer. Now node, npm and ghost can’t be found and nothing will run :frowning:

Got the same problem during local install on m1pro.
Nodejs 16.x(LTS) doesn’t work (sqlite3 issues…)
with nvm magic tricks and rosetta2, I tried nodejs 14 version (LTS) and it works like a charm !
I successfully installed ghost on an old intel based Mac mini and the official install works. So I guess it’s from nodeJS which is not for m1x chip.
Can’t wait for nodeJS Apple Silicon support !