Getting Started
Node.js
Section titled “Node.js”Before installing Node.js tooling with Homebrew, make sure Homebrew is installed and configured in your shell. See Installing Homebrew for macOS.
Fast Node Manager (fnm)
Section titled “Fast Node Manager (fnm)”Fast Node Manager (fnm) is a simple and fast Node.js version manager.
Installing fnm
Section titled “Installing fnm”To install fnm with Homebrew, run the following command:
brew install fnmNow, add the following line to the end of your ~/.zshrc file:
eval "$(fnm env --use-on-cd --shell zsh)"Commands
Section titled “Commands”To see a list of all commands for fnm, use:
fnm help| Command | Description |
|---|---|
fnm list-remote | List all remote Node.js versions [aliases: ls-remote] |
fnm list | List all locally installed Node.js versions [aliases: ls] |
fnm install <version> | Install a Node.js version [aliases: i] |
fnm install --lts | Install 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 current | Print the current Node.js version |
fnm uninstall <version> | Uninstall a Node.js version [aliases: uni] |
fnm help | Print this message or the help of the given subcommand(s) |
To check the installed Node.js version, run the following command:
node --versionOfficial Node.js Installer
Section titled “Official Node.js Installer”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.
Installing Bun
Section titled “Installing Bun”To install Bun run the following command:
curl -fsSL https://bun.com/install | bashbrew install oven-sh/bun/bunTo check that Bun was installed successfully, open a new terminal window and run:
bun --version# Output: 1.x.y
# See the precise commit of `oven-sh/bun` that you're usingbun --revision# Output: 1.x.y+b7982ac13189Adding Bun to your PATH
Section titled “Adding Bun to your PATH”For zsh, add this line to your .zshrc configuration file:
path=("$HOME/.bun/bin" $path)Then, reload your shell configuration or open a new terminal window.
Upgrading Bun
Section titled “Upgrading Bun”Once installed, the binary can upgrade itself:
bun upgrade