Ghost-CLI: Ghost-CLI: npm install sqlite3 --save error

Currently when using ghost-cli 1.0.0.4 and using ghost install local during the installation I get this error and the installation fails.

image

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 27 (9 by maintainers)

Commits related to this issue

Most upvoted comments

For anyone else who comes across this issue, it is caused by changing node versions after installing ghost-cli.

Sqlite3 is a binary dependency that comes with precompiled binaries and downloads the right one for your system on install. If you change the environment, it will look for a different binary, which wasn’t downloaded.

Ideally, the CLI would catch this error and explain clearly what the problem was 😬

Got the same error when using Node 14 LTS (Fedora 33, Yarn). Downgrading to Node 12 LTS and removing and reinstalling ghost-cli fixed it. (yarn global remove ghost-cli && yarn global add ghost-cli)

Hi,

I’ve been stuck on this issue for a while now. ghost --version Ghost-CLI version: 1.4.1 Ghost Version (at ~/Desktop/ghost/theme): 1.19.0

which ghost /usr/local/bin/ghost

npm root -g /usr/local/lib/node_modules

node --version v6.12.2

npm --version 5.6.0

I’ve tried using nvm, but then it gave me the same error or Error occurred running command: ‘yarn install --no-emoji --no-progress’ aka out of memory exception.

so then I brew install node@6 and do npm un -g ghost-cli && npm i -g ghost-cli

but then I get the same error: npm install sqlite3 --save error

I understand that the result of which ghost should be inside of npm root -g, but I have no idea how to make this possible. I’ve read this page multiple times and tried every command also.

Any suggestions ? Much thanks !!

how you installed node: –I use nvm how you installed ghost-cli: –I used npm un -g ghost-cli && npm i -g ghost-cli & also tried apending @latest in the install portion what version of node you were on when you installed ghost-cli: –I’ve tried with 6.9.5 & 6.11.1 what version of node you were on when you ran ghost install local: –I’ve tried with 6.9.5 & 6.11.1 the contents of /usr/lib/node_modules/ghost-cli/node_modules/sqlite3/lib/binding/ (cd into that folder and do ls -al.:
–There is no /usr/lib/node_modules on my computer (Mac osx 10.12.6) –However at /usr/local/lib/node_modules/ghost-cli/node_modules/sqlite3/lib/binding/

drwxr-xr-x  3 username  admin  102 Jul  8 14:33 .
drwxr-xr-x  6 username  admin  204 Jul  8 14:33 ..
drwxr-xr-x  3 username  admin  102 Jul  8 14:33 node-v51-darwin-x64

FOUND THE ISSUE. was with nvm.

An old version of ghost was trumping over the nvm managed one. I noticed nvm was installing to here /Users/username/.nvm/versions/node/v6.11.1/lib/node_modules/ghost-cli, but the above showed it was still present from a prior non nvm installed version. Therefore, uninstalling wasn’t removing the underlying incorrect version. Steps to fix: rm -rf /usr/local/lib/node_modules/ghost-cli //careful, am using -f here node --version //verify it’s a proper one nvm use v6.11.1 //if needed (or a similar version: https://docs.ghost.org/docs/supported-node-versions) npm un -g ghost-cli && npm i -g ghost-cli // Clean install ghost install local and voila

✔ Checking system Node.js version
✔ Checking current folder permissions
ℹ Checking operating system [skipped]
ℹ Checking MySQL is installed [skipped]
✔ Checking for latest Ghost version
✔ Setting up install directory
✔ Downloading and installing Ghost v1.0.2
✔ Finishing install process
✔ Configuring Ghost
✔ Setting up instance
✔ Running database migrations
✔ Validating config
✔ Starting Ghost
You can access your blog at http://localhost:2368/

Ghost uses direct mail by default
To set up an alternative email method read our docs at https://docs.ghost.org/docs/mail-config

This was fixed by uninstalling and reinstall of ghost-CLI.

npm un -g ghost-cli && npm i -g ghost-cli