Installing on macOS with MacPorts

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 JavaScriptnodejs7 @7.10.1 (devel, net)    Evented I/O for V8 JavaScriptnodejs8 @8.9.1 (devel, net)    Evented I/O for V8 JavaScriptnodejs9 @9.2.0 (devel, net)    Evented I/O for V8 JavaScriptFound 6 ports.--npm4 @4.6.1 (devel)    node package managernpm5 @5.5.1 (devel)    node package managerFound 4 ports.$ sudo port install nodejs8 npm5 .. long log of downloading and ...

Get Node.js Web Development - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.