Your ghost blog and Node 0.12.0

Update: Ghost version 0.5.10 now fully supports Node version 0.12.0
The article applies only to earlier versions of Ghost

It has been an exciting week with a new Node release. Community was waiting for Node.js version 0.12 and on Friday 6th of February, that wait was over.
I couldn't resist the idea of upgrading the node version on my server to the latest one and given that it's only a couple of commands and that I also wanted to upgrade the version of ghost to the latest one, I decided to do it.

Upgrading Node to 0.12.0

As promised, it's only a few lines of commands:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable

you can verify that you are running the latest version by typing node -v and you should get 0.12.0

Upgrading Ghost to version 0.5.8

To upgrade ghost, I just followed the regular upgrade instruction of taking a backup and then downloading the latest zip archive, unzipping it and overriding old ghost files.
You can find the step by step instructions at Upgrading Ghost.

Wait! it couldn't be that easy!

You are absolutely correct!
After preparing ghost, I ran npm install --production to make sure that all packages are up-to-date, but it complained about HTML-To-Text and sqlite3 packages.
It's time to get our hands dirty!

Fixing HTML-To-Text package

Ghost is declaring a dependency on HTML-To-Text version 1.0, which was not the latest one. I bumped it to the latest 1.2.0 version by editing package.json sudo nano package.json and then I also edited the module's package.json to change the supported node version. I knew that it's supported because the team already did that in the github repository.
This is all what's needed to resolve this problem.

Fixing sqlite3 package

when running npm install, I was receiving an error while trying to compile node-sqlite3 from source because a package for node 0.12 was not available. In order to resolve this error, I had to change the version of sqlite3 that ghost is declaring in package.json to 3.0.5, and then I ran npm install again.
Just make sure to have the build-essential in case you needed it.

Preparing Ghost

Now, everything should have been prepared and by running npm install --production it should pass without problems.
Just don't run Ghost yet as it will complain about Node version.
In package.json, change node dependency to be 0.12 and then run Ghost as usual npm start

Final thought

This is still hackish and I always recommend waiting the officially supported version, yet according to my current experience, ghost is running fine and I can see a welcome improvement in performance.