Homebrew is another open source software package manager for macOS, which some say is the perfect replacement for MacPorts. It is available through their home page at http://brew.sh/. After installing Homebrew using the instructions on their website and ensuring that Homebrew is correctly set up, use the following:
$ brew update
... long wait and lots of output
$ brew search node
==> Searching local taps...
nodelibbitcoin-node node-build node@6 nodeenv
leafnode llnode node@4 nodebrew nodenv
==> Searching taps on GitHub...
caskroom/cask/node-profiler
==> Searching blacklisted, migrated and deleted formulae...
Then, install it this way:
$ brew install node
...
==> Installing node
==> Downloading https://homebrew.bintray.com/bottles/node-8.9.1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring node-8.9.1.el_capitan.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary/usr/local/Cellar/node/8.9.1: 5,012 files, 49.6MB
Once installed this way, the Node.js command can be run as follows:
$ node --version v8.9.1
libbitcoin-node node-build node@6 nodeenv
/usr/local/Cellar/node/8.9.1: 5,012 files, 49.6MB