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 bashto update your source list with the version of Node.js you want to upgrade to.
sudo apt-get install -y nodejsto upgrade Node.js
ghost versionto get your current Ghost version
ghost update [version] --forceto 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.