Ghost 0.4 Install Problems

January 15, 2014 5.6k views
I decided to manually install Ghost 0.4. My problem is I get these errors when I run npm install --production. I tried to proceed with the installation but now ghost will not start and my site returns 502 errors. Any idea where the problem is? :) > sqlite3@2.1.19 install /var/www/ es/sqlite3 > node build.js [sqlite3]: Checking for 3-v2.1.a-node-v11-linux-x64.tar.gz [sqlite3]: Error: ENOENT, open '/home/tan/tmp/node-sqlite3-Release/node_sqlite3- v2.1.a-node-v11-linux-x64.tar.gz' npm ERR! sqlite3@2.1.19 install: `node build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sqlite3@2.1.19 install script. npm ERR! This is most likely a problem with the sqlite3 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node build.js npm ERR! You can get their info via: npm ERR! npm owner ls sqlite3 npm ERR! There is likely additional logging output above. npm ERR! System Linux 3.8.0-29-generic npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "--production" npm ERR! cwd /var/www/ npm ERR! node -v v0.10.24 npm ERR! npm -v 1.3.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /var/www/
7 Answers
Seems like a problem with the sqlite3 package itself. The downloaded archive could be corrupted, try clearing .npm's cache:
npm cache clean
I decided to reinstall everything using the DO ghost app... The original droplet was a manual install. Don't know if DO uses a different setup to make ghost run.
I had to rollback the version of sqlite3 from 2.2.19 to 2.2.15, didn't work with the newer 2.2.0 version that was just released... Lame. Regardless though, in the package.json file change this line
"sqlite3": "2.1.19"
to this
"sqlite3": "2.1.15"
Ran into an issue starting afterwards. Go into package.json again and change this under scripts "start": "node index"to this "start": "nodejs index". They were still using the legacy binary name for nodejs and that caused issue...
Seems to work for me when I rebuild the sqlite3 package from source.

sudo npm install sqlite3 --build-from-source

Then just run as before:

sudo npm install --production
sudo npm start
Same problem and none solution above works :-(
I symlinked nodejs to node to get around the naming issue. This is also what Joyent recommends trying.

% ln -s /usr/bin/nodejs /usr/bin/node

Fixed my issues.
Have another answer? Share your knowledge.