Macos How To Run Complied Nodejs App

Download here


Node.js is an open source JavaScript runtime environment for easily building server-side applications. It’s also the runtime that powers many client-side development tools for modern JavaScript frameworks.

In this tutorial, you’ll set up a Node.js programming environment on your local macOS machine using Homebrew, and you’ll test your environment out by writing a simple Node.js program.

After you have installed node.js with npm, you can confirm that the two are installed by issuing either command with a -v flag to check the version: node -v. How to Test that Node.js is Working. Once the node.js package is installed on the Mac you can test it’s working by starting a simple web server. Node.js in a container. In this guide you will learn how to: Create a Dockerfile file for an Express Node.js service container; Build, run, and verify the functionality of the service; Debug the service running within a container; Prerequisites. Both Docker and the VS Code Docker extension must be installed as described in the overview; Node.js.


You will need a macOS computer running High Sierra or higher with administrative access and an internet connection.

Step 1 — Using the macOS Terminal

Macos How To Run Complied Nodejs Appropriate

You’ll use the command line to install Node.js and run various commands related to developing Node.js applications. The command line is a non-graphical way to interact with your computer. Instead of clicking buttons with your mouse, you’ll type commands as text and receive text-based feedback. The command line, also known as a shell, lets you automate many tasks you do on your computer daily, and is an essential tool for software developers.

To access the command line interface, you’ll use the Terminal application provided by macOS. Like any other application, you can find it by going into Finder, navigating to the Applications folder, and then into the Utilities folder. From here, double-click the Terminal application to open it up. Alternatively, you can use Spotlight by holding down the COMMAND key and pressing SPACE to find Terminal by typing it out in the box that appears.

If you’d like to get comfortable using the command line, take a look at An Introduction to the Linux Terminal. The command line interface on macOS is very similar, and the concepts in that tutorial are directly applicable.

Now that you have the Terminal running, let’s install some prerequisites we’ll need for Node.js.

Step 2 — Installing Xcode’s Command Line Tools

Xcode is an integrated development environment (IDE) that is comprised of software development tools for macOS. You won’t need Xcode to write Node.js programs, but Node.js and some of its components will rely on Xcode’s Command Line Tools package.

Execute this command in the Terminal to download and install these components:

You’ll be prompted to start the installation, and then prompted again to accept a software license. Then the tools will download and install automatically.

We’re now ready to install the package manager Homebrew, which will let us install the latest version of Node.js.

Step 3 — Installing and Setting Up Homebrew

While the command line interface on macOS has a lot of the functionality you’d find in Linux and other Unix systems, it does not ship with a good package manager. A package manager is a collection of software tools that work to automate software installations, configurations, and upgrades. They keep the software they install in a central location and can maintain all software packages on the system in formats that are commonly used. Homebrew is a free and open-source software package managing system that simplifies the installation of software on macOS. We’ll use Homebrew to install the most recent version of Node.js.

To install Homebrew, type this command into your Terminal window:

The command uses curl to download the Homebrew installation script from Homebrew's Git repository on GitHub.

Let’s walk through the flags that are associated with the curl command:

  • The -f or --fail flag tells the Terminal window to give no HTML document output on server errors.
  • The -s or --silent flag mutes curl so that it does not show the progress meter, and combined with the -S or --show-error flag it will ensure that curl shows an error message if it fails.
  • The -L or --location flag will tell curl to handle redirects. If the server reports that the requested page has moved to a different location, it'll automatically execute the request again using the new location.

Once curl downloads the script, it's then executed by the Ruby interpreter that ships with macOS, starting the Homebrew installation process.

The installation script will explain what it will do and will prompt you to confirm that you want to do it. This lets you know exactly what Homebrew is going to do to your system before you let it proceed. It also ensures you have the prerequisites in place before it continues.

You’ll be prompted to enter your password during the process. However, when you type your password, your keystrokes will not display in the Terminal window. This is a security measure and is something you’ll see often when prompted for passwords on the command line. Even though you don’t see them, your keystrokes are being recorded by the system, so press the RETURN key once you’ve entered your password.

Macos How To Run Complied Nodejs Apps

Press the letter y for “yes” whenever you are prompted to confirm the installation.

Now let’s verify that Homebrew is set up correctly. Execute this command:

If no updates are required at this time, you’ll see this in your Terminal:

Otherwise, you may get a warning to run another command such as brew update to ensure that your installation of Homebrew is up to date.

Now that Homebrew is installed, you can install Node.js.

Step 4 — Installing Node.js

With Homebrew installed, you can install a wide range of software and developer tools. We’ll use it to install Node.js and its dependencies.

You can use Homebrew to search for everything you can install with the brew search command, but to provide us with a shorter list, let’s instead search for packages related to Node.js:

You’ll see a list of packages you can install, like this:

Both of these packages install Node.js on your system. They both exist just in case you can’t remember if you need to use nodejs or node.js.

Execute this command to install the nodejs package:

You’ll see output similar to the following in your Terminal. Homebrew will install many dependencies, but will eventually download and install Node.js itself:

In addition to Node.js itself, Homebrew installs a few related tools, including npm, which makes it easy to install and update Node.js libraries and packages you might use in your own projects.

To check the version of Node.js that you installed, type

This will output the specific version of Node.js that is currently installed, which will by default be the most up-to-date stable version of Node.js that is available.

Check the version of npm with

You’ll see the version displayed:

You’ll use npm to install additional components, libraries, and frameworks.

To update your version of Node.js, you can first update Homebrew to get the latest list of packages, and then upgrade Node.js itself:

Now that Node.js is installed, let’s write a program to ensure everything works.

Step 5 — Creating a Simple Program

Let’s create a simple ‘Hello, World’ program. This will make sure that our environment is working and gets you comfortable creating and running a Node.js program.

To do this, create a new file called hello.js using nano:

Type the following code into the file: hello.js

Exit the editor by pressing CTRL+X. Then press y when prompted to save the file. You'll be returned to your prompt.

Now run the program with the following command:

The program executes and displays its output to the screen:

This simple program proves that you have a working development environment. You can use this environment to continue exploring Node.js and build larger, more interesting projects.


You’ve successfully installed Node.js, npm, and tested out your setup by creating and running a simple program. You can now use this to develop client-side apps or server-side apps. Take a look at the following tutorials to learn more:

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Here’s how I get productive for JavaScript/Node on Mac OS.

It includes iTerm2, zsh, Node, Visual Studio Code and some git commands.

Table of Contents

Setup iTerm2

  • Install iTerm2

Change edit mode to natural text

  • iTerm Preferences → Profiles → select your profile → Keys tab → Load Preset… → Natural Text Editing (See this StackOverflow answer)

New session should start where previous left off

  • iTerm Preferences → Profiles → select your profile → General tab → Working Directory section → Reuse previous session’s directory option

Quit on tab close

  • iTerm Preferences → General, “Closing” → “Quit when all windows are closed”

Increase font size

  • iTerm Preferences → Profiles → select your profile → Text tab → Font section → Change font → Update font in the popup
  • Fan of 16pt Monaco (12, 14 is just too small)

Enable infinite history

  • iTerm Preferences → Profiles → select your profile → Terminal tab → Unlimited scrollback

Shell setup


With oh-my-zsh manager. Sets you up with auto-completion.

snazzy colour theme

Using iterm-snazzy, which is a case of downloading the .itermcolors file and choosing the theme from (iTerm Preferences → Profile > Colors > Color Presets…).

Pure prompt

It’s simple, clean but gives you enough information to be productive.

(see Setup and configuration for how to get Node/npm up and running)

  • Install using npm: npm install --global pure-prompt
  • Initialise by adding the following to your .zshrc:

As a developer it’s always good to have a few browsers and tools handy:

  • Google Chrome: still a goto due to its solid and extensive dev tools. Usually I install the React or Vue dev tools.
  • Postman for Mac: to manually test APIs
  • Firefox: number 2 browser
  • Brave: auto-blocks ads and tracking, sort of the “play” browser, its dev tools are a buggier/less ergonomic version of Chrome dev tools (this is because Brave uses Chromium under the hood)
  • Safari — installed by default on Mac OSX, it’s a buggy browser, good to test using it since it surfaces weird SVG and cookies security policy quirks. Since it’s the default it’s also widely used by non-technical people.
  • Enable the dev tools: Safari → Preferences → Advanced → Show develop menu in menu bar.

I use Visual Studio Code, it strikes the right balance between usable out of the box and customisable. The way I see it editors like vim or Atom need a bit of config before being productive, and others like Sublime or IDEs (WebStorm) don’t have the same plugin ecosystem.

Install VSCode command line tools

Open the dialog using CMD + P.

Use: Shell Command: Install 'code' command in PATH

The VSCode command line tool usage examples:

  • code . : open . directory in VSCode
  • code -r . : replace directory opened in VSCode with the current directory
  • code -a . : add current directory to VSCode, ie. initialises a workspace

Must-have extensions

  • Atom keymap: I’m not a fan of the default keybindings, this uses Atom-style ones, get it from the Visual Studio Marketplace or ext install atom-keybindings from CMD + P menu
  • EditorConfig for VS Code: “EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs.” (see, ie. helps you deal with tab size, trimming spaces etc. across code editors, get it here from the Visual Studio Marketplace or ext install EditorConfig from CMD + P menu

Nice to have extensions

  • ESLint: “Integrates ESLint JavaScript into VS Code.”, get it from the Visual Studio Marketplace or ext install vscode-eslint from CMD + P menu
  • npm Intellisense: “autocomplete npm modules in import statements”, get it from the Visual Studio Marketplace or ext install npm-intellisense from CMD + P menu
  • Snazzy theme: same colour theme (snazzy) as I’ve got setup for the terminal for VSCode, get it from the Visual Studio Marketplace or ext install snazzy theme
  • Import Cost: “Display import/require package size in the editor”, get it from the Visual Studio Marketplace, or ext install import-cost

Not many productivity apps, just Alfred, which I use as a better Spotlight Search and Clipy which is a clipboard manager.


A simple clipboard manager designed for OSX.

It works out of the box better than Clipy (see below).

Install it through Homebrew:

Update the preferred hotkey to CMD + shift + v:

Paste by default on selection of a clipboard item:

Superseded by Maccy Clipy

Bump up the number of “inline items” (Clipy → Preferences → Menu → Number of items place inline).

Set your screenshots to save to clipboard + enable the option to paste as plain text (Clipy → Preferences → Beta → Paste as PlainText + Save screenshots in history).

Update Xcode using xcode-select--``install.

Install Homebrew for package managements (think apt or pkg for Mac):

Install Node.js either from source, using the Mac installer or using Homebrew:

Install n – Interactively Manage Your Node.js Versions using npm (now that we have Node installed):npm install--``global n

Switch to latest Node version using n:sudo n latest

Install jq (format and deal with JSON nicely in the terminal) and watch (run a command repeatedly) using Homebrew

Add a few git extensions:

  • git-open: “Type git open to open the GitHub page or website for a repository in your browser.” using npm install --global git-open
  • git-standup: “Recall what you did on the last working day.” using git standup, there are multiple install options (see git-standup#install), I usually go with: brew install git-standup
  • git-lg: simpler/prettier git log:

Add the following minimal .vimrc, which enables syntax highlighting, has basic tab/tabsize configuration and enables line numbers display:

Set up SSH keys and add to VCS hosting, see this GitHub help article:

  • Generate a new key: ssh-keygen -t rsa -b 4096 -C '*[email protected]*'
  • Copy your public key to clipboard so you can paste it wherever your hosted Version Control system asks you to: pbcopy < ~/.ssh/

Put percentage on power level, right-click the battery indicator and select “Show Percentage”.

❤️ Spotify

More at my /uses page.

(Optional) Docker, VirtualBox

Docker is a containerisation technology, think VMs but smaller. I recommend Docker for Mac.VirtualBox allows you to run Virtual Machines on Mac, install it at VirtualBox downloads.

Get The Jest Handbook (100 pages)

Take your JavaScript testing to the next level by learning the ins and outs of Jest, the top JavaScript testing library.


Join 1000s of developers learning about Enterprise-grade Node.js & JavaScript

Download here