Ghost blogs built with DigitalOcean’s One-Click application before February 11th, 2016 came with Node.js built from source. More recent ones install it using the Nodesource Apt repository. These can update Node.js by simply running:
- sudo apt-get update
- sudo apt-get upgrade
How can you update the version of Node.js to the most recent LTS version on an older Ghost Droplet?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
There are multiple methods you can use to update Node.js on your older Ghost Droplet. Here I’ll explain how to do it using the Nodesource Apt repository. Tools like
nvmcould also be used, but I’ve chosen to use the repository in order to be consistent with how newer Ghost Droplets are created and so that you can receive ongoing updates to Node.js via your package manager as you apply normal updates.
First, confirm that you are using an older version that was installed from source. Run:
If the output is
/usr/local/bin/nodeas opposed to simply
/usr/bin/node, then you are using an older version.
To add the Nodesource repository and install the latest LTS version of Node.js, run:
After installation completes, verify that you have an up-to-date Node.js by running:
Next, we’ll need to update the Upstart script that is used to run Ghost. Temporarily shutdown Ghost with the command
sudo service ghost stopNow, edit the file
/etc/init.d/ghostand replace all instances of
/usr/bin/npmWhen you are done, it should look like:
Now, restart Ghost and confirm it is running as expected:
Finally, after you’ve made sure that everything is successfully installed and running, you can delete both