Upgrade Node.js for your Ghost
Upgrade Node.js
When upgrading Node.js, you need to run the update for Node and then also re-install Ghost’s dependencies. This is because Ghost has several binary dependencies which are compiled for the specific Node.js version. Without reinstalling dependencies, Ghost will fail to start with strange error messages.
To upgrade the steps are:
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash
to update your source list with the version of Node.js you want to upgrade to.sudo apt-get install -y nodejs
to upgrade Node.js- Run
ghost version
to get your current Ghost version ghost update [version] --force
to force Ghost to reinstall your current version of Ghost, to trigger a re-installation of dependencies.
It’s not recommended updating Node and Ghost at the same time. Reinstalling the current version of Ghost ensures that the Node is updated correctly first, so that you can be sure that Ghost will update smoothly.