Here we will get some easiest and prominent ways to update Node.js in Mac. Knowing the concept is important because, in NPM, few latest JavaScript libraries need the recent version of Node.js.
$ node -v v x.x.x
$ sudo npm install -g n
(If you want to install stable version so use this command to install the stable node release.)
$ sudo n stable
(If you want to install latest version so use this command to install the latest node release.)
$ sudo n latest
(If you want to install LTS version so use this command to install the LTS node release.)
$ sudo n lts
(If you want to install custom version so use this command to install the custom node release.)
$ sudo n 14.18.1
$ node -v v x.x.x
Quick Links