Upgrading Node, Go and Hugo for this website
Time for some routine maintenance. Need to upgrade the dependencies for this website and fix any resulting issues.
Switch from NVM for Windows to fnm §
To manage Node, I had been using NVM for Windows. However, that appears to no longer be recommended. Instead, fnm seems to be officially endorsed as the default installed for Node on Windows. And fnm can be installed using Scoop, which I already use for managing packages on Windows.
So the steps are (using PowerShell):
Install Scoop.
Install fnm using Scoop:
Configure fnm to be accessible from PowerShell:
In the Notepad window, paste this and then save:
Re-open the PowerShell window.
Install fnm and Node v20.18.0 and npm v10.8.2:
Done. It should now be possible to use fnm from within PowerShell.
Note that fnm will automatically read any .nvmrc
file in the current directory, and offer to install that Node version if it does not already exist.
Uprading Node §
Upgraded from Node v18.8.0 to v20.18.0.
Did so by doing fnm use --install-if-missing 20
, and then updating .nvmrc
to contain v20.18.0
.
Upgrading Go §
Upgraded from Go v1.20.5 to v1.23.2.
Did so by installing Go v1.23.2 from the website, then updating GO_VERSION
in hugo.toml
to GO_VERSION = "1.23.2"
.
Upgrading Hugo §
Upgraded from Hugo v0.115.1 to v0.136.2.
Did so by installing Hugo via Scoop:
Then updating HUGO_VERSION
in hugo.toml
to HUGO_VERSION = "0.136.2"
.
Fixed some deprecation warnings and errors.
Pagination §
Got the warning:
Fixed by changing
To:
Use of .Site.IsServer
within a Go module §
Started getting this error:
Searched codebase for .Site.IsServer
and found nothing. Suspected that the problem lay with some third-party code. The only possible suspect is the plausible-hugo Go module.
Initially tried to upgrade plausible-hugo:
That failed.
Tried listing all Go modules:
That succeeded.
Tried to update plausible-hugo specifically:
That succeeded.
Though in hindsight, perhaps I should have used hugo mod get -u
?