How To Fix NVM not showing latest versions of node

If you're trying to use nvm  to upgrade to use a more recent version of node, but you're not seeing a later version, it's likely due to your local nvm not having the most recent versions available. nvm keeps a list of versions you can install, viewable with nvm ls

user@mycoolbox:~$ nvm ls
->     v14.18.0
         system
default -> lts/* (-> v14.18.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v14.18.0) (default)
stable -> 14.18 (-> v14.18.0) (default)
lts/* -> lts/fermium (-> v14.18.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.6 (-> N/A)
lts/fermium -> v14.18.0

As you can see, later versions like Node 16 or 18 aren't present.

Simply run nvm ls-remote, and you'll get the complete list of versions available.

Then you can run nvm ls and see the new LTS versions.

user@mycoolbox:~$ nvm ls
       v14.18.0
->     v16.20.2
         system
default -> lts/* (-> N/A)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v16.20.2) (default)
stable -> 16.20 (-> v16.20.2) (default)
lts/* -> lts/hydrogen (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.17.1 (-> N/A)
note that gallium and hydrogen are now present and can be installed

Installation with nvm install lts/gallium worked after this.