Getting error when trying to upgrade to ghost 3.x

I’m trying to upgrade to ghost 3.x and getting this error message detailed below (just running ghost update)

  • What version of Ghost are you using?
    2.28.0

What configuration?
running an AWS EC2 (t2.micro)

What errors or information do you see in the console?

Debug Information:
OS: Ubuntu, v18.04
Node Version: v12.16.2
Ghost-CLI Version: 1.12.0
Environment: production
Command: ‘ghost update’
Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_ec2-13-127-144-101-ap-south-1-compute-amazonaws-com -n 50
Stack: Error: Could not communicate with Ghost
at Server. (/usr/lib/node_modules/ghost-cli/lib/utils/port-polling.js:56:20)
at Object.onceWrapper (events.js:416:28)
at Server.emit (events.js:310:20)
at emitCloseNT (net.js:1657:8)
at processTicksAndRejections (internal/process/task_queues.js:83:21)

I tried running the command in the suggestion: journalctl -u ghost_ec2-13-127-144-101-ap-south-1-compute-amazonaws-com -n 50 and then trying ghost update again but got the same error

Can you take a look at this thread and see if it helps?

Hey - yeah that thread was helpful. To summarize, for anyone else running into this too, these are the steps I followed which did the trick for me:

check node -v which gave v12.16.2 and nodejs -v which gave v8.16.2 (the nodejs version < 10 is the source of the problem AFAIK)

I removed this version of nodejs using sudo apt-get remove nodejs and then installed nodejs v12.x (13.x seems to be latest but I think ghost doesn’t support nodejs v13 yet) from nodesource: https://github.com/nodesource/distributions/blob/master/README.md

check node -v and nodejs -v which now both give v12.16.2

then

ghost stop
ghost update
ghost start

Thanks vikas!