How do you update the default version of Nano on MacOS X without using the homebrew package manager?
Recent Macs ship with GNU nano version 2.0.6, which is a far cry from the latest version 4.3.

GNU nano is written in C and thus very easy to build from source. To do this, try the steps below that are reproduced from the README file that is included in the source code which you can find here:


curl -O  https://www.nano-editor.org/dist/v4/nano-4.3.tar.gz
tar xvzf nano-4.3.tar.gz
cd nano-4.3
./configure
make
make install


You should then have an up to date version of the binary. This does not replace the nano that ships with macOS - but it allows you to have one you can patch faster (or to a different level) than Apple updates it. You will have to make sure you add the path to the nano above to your path before /usr/bin/nano is in the $PATH

Many people like https://brew.sh since it fixes your path and then installs nano and other tools correctly so they run before the system versions.