Skip to content

Getting Started

Homebrew is a popular package manager for macOS. To install Homebrew, run the following command:

Terminal window
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Fast Node Manager (fnm) is a simple and fast Node.js version manager.

Demo of fnm

To install fnm with Homebrew, run the following command:

Terminal window
brew install fnm

Now, add the following lines to your ~/.zshrc file:

Terminal window
eval "$(fnm env --use-on-cd --shell zsh)"

To see a list of all commands for fnm, use:

Terminal window
fnm help
CommandDescription
fnm list-remoteList all remote Node.js versions [aliases: ls-remote]
fnm listList all locally installed Node.js versions [aliases: ls]
fnm install <version>Install a Node.js version [aliases: i]
fnm install --ltsInstall the latest stable version of Node.js [aliases: i]
fnm use <version>Change Node.js version
fnm default <version>Set a version as the default version
fnm currentPrint the current Node.js version
fnm uninstall <version>Uninstall a Node.js version [aliases: uni]
fnm helpPrint this message or the help of the given subcommand(s)

To check the installed Node.js version, run the following command:

Terminal window
node --version

Alternatively, you can download the official Node.js installer from the Node.js website.

Bun is a fast, incrementally adoptable all-in-one JavaScript, TypeScript & JSX toolkit. Use individual tools like bun test or bun install in Node.js projects, or adopt the complete stack with a fast JavaScript runtime, bundler, test runner, and package manager built in. Bun aims for 100% Node.js compatibility.

To install Bun run the following command:

Terminal window
curl -fsSL https://bun.com/install | bash

To check that Bun was installed successfully, open a new terminal window and run:

Terminal window
bun --version
# Output: 1.x.y
# See the precise commit of `oven-sh/bun` that you're using
bun --revision
# Output: 1.x.y+b7982ac13189
  1. Determine which shell you’re using:

    Terminal window
    echo $SHELL
    # /bin/zsh or /bin/bash or /bin/fish
  2. Open your shell configuration file:

    • For bash: ~/.bashrc
    • For zsh: ~/.zshrc
    • For fish: ~/.config/fish/config.fish
  3. To add the Bun directory to PATH, add this line to your configuration file:

    Terminal window
    export BUN_INSTALL="$HOME/.bun"
    export PATH="$BUN_INSTALL/bin:$PATH"
  4. Reload your shell configuration:

    Terminal window
    source ~/.bashrc # or ~/.zshrc or ~/.config/fish/config.fish

Once installed, the binary can upgrade itself:

Terminal window
bun upgrade