I have a problem. I am currently using Node.js version 18.17.1. What is the best way to update my Node.js version to 20 when Ghost supports version 20, without breaking my website? Could you please show me the steps?
Just checked now and I have Node v16 on my Droplet. I wonder what are the steps to exactly install the v 18 without breaking anything. I found a guide on DO about using NVM but I’m not sure.
Can I ask what are the commands you used to install the 18.x (Node v18 Hydrogen LTS)?
I’ve started upgrading to the v18 using this guide. Ghost admin panel is now unreachable and the process already started 15 minutes ago. I wonder how long it takes to upgrade Node from start to finish?
Did. Now I have this error in the console: Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED ::1:3306
Apparently the new Node 18 breaks something.
Yes, I first updated Node, then panicked and also updated Ghost itself. Now everything works. I solved by removing the line that starts with ::1 in etc/hosts. I found the solution on Stack Overflow:
localhost is translated to ::1 (IP6) instead of 127.0.0.1 (IP4). The error occurs because your database is listening on localhost and you try to connect to 127.0.0.1 or the database is listening on 127.0.0.1 and you try to connect to localhost.
The line I removed in hosts is the following:
::1 localhost ip6-localhost ip6-loopback
Now I have the shiny new Ghost, even if I didn’t really want to upgrade also that, but just the Node
No, I have also ipv6. My hosts file is now the following:
# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.debian.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/cloud.cfg or cloud-config from user-data
#
127.0.1.1 ghostonubuntu2204-s-1vcpu-1gb-intel
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Before was this:
# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.debian.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/cloud.cg or cloud-config from user-data
127.0.1.1 ghostonubuntu2204-5.-1vcpu-1gb-intel
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02: :1 jp6-allnodes
ff02: :2 ip6-allrouters