Can't upgrade from v3 to v4

Hi guys,

I’m running ghost on a DigitalOcean Ubuntu server.
I was able to upgrade it from 1.x to 3.42.5 but now I’m stuck because upgrading to the latest v4 doesn’t work because of an outdated node version.
However, I followed the instructions at Supported node versions for self-hosted installs of Ghost and installed node v14 and when I enter nodejs -v at the prompt I do get v14.17.2 as the answer. But when I enter node -v I get v10.16.3 and that’s exactly the version ghost is complaining about when trying to upgrade.

So, apparently the ghost update process wants to use node and the node upgrade instructions upgraded nodejs. So what can I do? What’s the difference between node and nodejs? On my Ubuntu installation which node gives /usr/local/bin/node while which nodejs gives /usr/bin/nodejs.
I already rebooted the VM and treid to upgrade node again according to the instructions in the link above but it doesn’t update anymore because it’s already at the latest version, 14.17.2. :man_shrugging:

Any help much appreciated! Thanks so much!

Can you remember how you installed Node originally? It seems like it was a different method to that in the docs, so following the upgrade guide has resulted in Node being installed a second time, rather than upgrading.

You’ll need to uninstall one version or another and make sure Ghost is referencing the remaining one, but it’s difficult to give exact instructions without being sure how the original node version was installed.

Hi Hannah and thanks for answering! Much appreciated!
No, I don’t remember how I installed Node originally. I guess it came with the Ubuntu installation? But because I was struggling a lot with ghost and updating it (being an early 0.x user) it’s pretty much possible that I once fiddled with node problems manually, too. :disappointed:
How would I uninstall the older node version in /usr/local/bin/node? I’m a bit afraid that I damage more than I heal when interfering with different node versions and node vs. nodejs

I think you need node 14.16.1. Try that.

I do have nodejs 14.17.2 installed – AND node 10.16.3. The problem is that ghost’s update process uses the old node version. If I downgrade 14.17.2 to 14.16.1 you suggest (I wouldn’t know how to do that, btw) I guess this won’t solve the problem. Ghost’s update process still will use the wrong node 10.16.3 version.

When you do

node -v
#=> 14.16.1

You should get Ghost install. You may need to get help from Stack overflow for node related issues.

This was a very important question.

Problem solved!
I did a bit of a hack: renamed /usr/local/bin/node to some other name and then symbolically linked /usr/bin/nodejs to /usr/local/bin/node.
Then, ghost update (launched from within /var/www/ghost) still complained about several file permissions but gave the commandline to fix those, too. Excellent! I did that and ran ghost update again and this time it worked without a problem! :smiley: