Installing Node

The team’s setup check is moving from Python to JavaScript. Before you port it, you need a program that runs JavaScript from your terminal. You’ll install Node.js and verify which version runs, much as you check a Python installation.

Choose a JavaScript Runtime

JavaScript runs in every browser and in standalone runtimes, programs that execute the language outside a browser, including Node, Deno, and Bun. This course uses Node because it’s the most common way to run JavaScript like a Python script.

Node supplies the node command, the counterpart to python. Its name identifies the runtime rather than the language because several programs run JavaScript. Each runtime adds its own facilities around the language. Node provides access to your terminal and file system, which the setup check needs.

Install Node 26

Use fnm, a version manager like pyenv, to install the course’s version, Node 26. fnm supports Windows, Linux, and macOS and lets you switch versions later. Another popular manager, nvm, supports macOS and Linux. Follow the fnm steps for your system:

In PowerShell, install fnm through Windows 10 and 11’s WinGet package manager. If winget isn’t found, follow Microsoft’s WinGet installation instructions to install or register App Installer, then retry:

Language: Windows PowerShell
PS> winget install Schniz.fnm

Open a new PowerShell window so it finds fnm. PowerShell blocks profile scripts by default. Allow locally written scripts, answering Y if asked, then create your profile if needed and open it:

Language: Windows PowerShell
PS> Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
PS> if (-not (Test-Path $PROFILE)) { New-Item $PROFILE -Force }
PS> notepad $PROFILE

Your profile runs when PowerShell starts. Add this line, save, and close Notepad:

Language: PowerShell Script
fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression

Open a new PowerShell window to load that setup, then install Node 26:

Language: Windows PowerShell
PS> fnm install 26

fnm downloads Node into your user folder. If you already have another fnm-managed version, select 26 as the default for new windows:

Language: Windows PowerShell
PS> fnm default 26

fnm’s install script needs curl and unzip. On Ubuntu or Debian, install missing prerequisites with:

Language: Shell
$ sudo apt install curl unzip

For other distributions, install those tools through the package manager. Then install fnm:

Language: Shell
$ curl -fsSL https://fnm.vercel.app/install | bash

The script installs fnm in your home folder and configures Bash, Zsh, or fish through the shell’s startup file, such as ~/.bashrc. Open a new terminal to load that setup, then install Node 26:

Language: Shell
$ fnm install 26

fnm downloads Node into your home folder. If you already have another fnm-managed version, select 26 as the default for new terminals:

Language: Shell
$ fnm default 26

On macOS, fnm’s install script uses Homebrew. Open Terminal and check for it:

Language: Shell
$ brew --version

If brew isn’t found, install Homebrew using the command on its home page. Then install fnm:

Language: Shell
$ curl -fsSL https://fnm.vercel.app/install | bash

Homebrew’s installer now only works on Apple silicon Macs. On an Intel Mac without Homebrew, or to skip Homebrew, run the script with --force-no-brew instead:

Language: Shell
$ curl -fsSL https://fnm.vercel.app/install | bash -s -- --force-no-brew

Either way, the script configures your shell’s startup file, usually ~/.zshrc for macOS’s default Zsh shell. Open a new terminal to load that setup, then install Node 26:

Language: Shell
$ fnm install 26

fnm downloads Node into your home folder. If you already had another fnm-managed version, select 26 as the default for new terminals:

Language: Shell
$ fnm default 26

The first version fnm installs becomes the default automatically. You can instead choose Node 26 from the official download page, using its installer where available. Avoid an old Node package from your operating system’s repositories. Installing Node yourself doesn’t replace the system Python that operating system tools may depend on.

Check the Command

Open a fresh terminal and verify the version that the setup check will report:

Language: Windows PowerShell
PS> node -v
v26.13.0
Language: Shell
$ node -v
v26.13.0

Your minor and patch numbers may differ. The major number should be 26. If you installed through fnm and another major version runs, use fnm use 26 in the current shell. With --use-on-cd enabled, entering a project with a .node-version or .nvmrc file can select that project’s version instead of your default.

For fnm installations, use fnm default to display the default version for new terminals. If node isn’t found, check that fnm’s shell setup loaded. On Windows, verify the profile’s fnm env line.

If you used the official installer and node isn’t found, rerun the Node 26 installer and complete its installation. Close and reopen your terminal afterward. If an older version still runs, locate it with where.exe node in PowerShell or command -v node on macOS or Linux. Remove that older installation or move the Node 26 installation folder ahead of it on PATH.

Restart an already running editor completely before opening another terminal tab inside it, whichever installation method you chose.

node --version gives the same result. Unlike Python’s uppercase -V, Node’s short version flag is lowercase -v. The installation also includes npm, a command for installing JavaScript packages. You won’t need packages yet. Use your existing code editor for the script, or Visual Studio Code if you need one.

In the next lesson, Trying JavaScript in the REPL, you’ll open Node’s interactive prompt with node, try expressions, and leave it again. You’ll also use node -p for a one-off expression, like python -c with the result printed for you.

Become a Member to join the conversation.