The MacPorts project (http://www.macports.org/) has for years been packaging a long list of open source software packages for macOS, and they have packaged Node.js. After you have installed MacPorts using the installer on their website, installing Node.js is pretty much this simple:
$ port search nodejs npm
...
nodejs6 @6.12.0 (devel, net)
Evented I/O for V8 JavaScript
nodejs7 @7.10.1 (devel, net)
Evented I/O for V8 JavaScript
nodejs8 @8.9.1 (devel, net)
Evented I/O for V8 JavaScript
nodejs9 @9.2.0 (devel, net)
Evented I/O for V8 JavaScript
Found 6 ports.
--
npm4 @4.6.1 (devel)
node package manager
npm5 @5.5.1 (devel)
node package manager
Found 4 ports.
$ sudo port install nodejs8 npm5 .. long log of downloading and installing prerequisites and Node $ which node /opt/local/bin/node $ node --version v8.9.1