Attempt to Upgrade 2 to 3 fails

Hmmm… I’ve done find . | grep 'node$' and find . | grep 'nodejs$' and then tried running every instance that came back with the -v flag. I’ve only been able to find 12.x and 13.x instances on this VM, so I have no idea where to go next.

Hmm, maybe you can run ghost run and see if it still crashes. If it doesn’t, try running sudo -u ghost node -v

ghost run seems to work, though I do get a few warnings:

[2020-04-03 18:25:08] INFO Ghost is running in production...
[2020-04-03 18:25:08] INFO Your site is now available
[2020-04-03 18:25:08] INFO Ctrl+C to shut down
[2020-04-03 18:25:08] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2020-04-03 18:25:08] WARN Tries: 0
[2020-04-03 18:25:08] WARN Retrying...
[2020-04-03 18:25:08] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2020-04-03 18:25:08] WARN Tries: 1
[2020-04-03 18:25:08] WARN Retrying...
[2020-04-03 18:25:08] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2020-04-03 18:25:08] WARN Tries: 2
[2020-04-03 18:25:08] WARN Retrying...
[2020-04-03 18:25:08] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2020-04-03 18:25:08] INFO Ghost boot 3.556s

and

ghost-mgr@lamarche:/var/www/ghost$ sudo -u ghost node -v
v12.16.1

Interestingly, the last time I reverted from a failed upgrade, Ghost 2.0 hung on start also, but then worked after a restart. I’m hesitant to not roll back when it fails to update, though, because if restarting doesn’t fix it, I’m stuck having to roll back across major versions manually.

So, just a followup. I tried updating by doing

ghost stop
ghost update
ghost start

Which does not seem like it should have given a different result, but it did. I’m now running Ghost 3.

(If you decide to risk this like I did, make sure you back everything up beforehand!)

I had the same problem when upgrading from 2.x to 3.x. But for me i believe i fall trap with upgrading the node version. Initially i installed node using apt-get install nodejs. But this time i removed it and installed it using nvm, because my azure vm is running Ubuntu Bionic and doesn’t have v12 in apt-get repository, but nvm has. The problem with nvm install though is, it doesn’t simlink /usr/bin/node to the installed version in the user directory under ~/.nvm, but just adds it to the environment path variable.

Apparently ghost-cli is somehow tied to /usr/bin/node path, because in journalctl the error seems to be related to not able to locate node under /usr/bin/node. I simlink’ed it using ln -f /home/.nvm/.../node /usr/bin/node , and ran ghost start. It worked without any issues.

As for the problem with the fs-extras module error, i have to remove the <ghostdir>/current/node_modules, run npm install with the new version of node for 3.0 and then run ghost update followed by ghost start.

Thought i will share it here for people from the future.