Wood Chen

Installing Node.js with Homebrew

0 comments110 views250 words

This post was translated from Chinese by AI. If anything reads oddly, the Chinese original is authoritative. 中文原文

What does brew install node do?

This command installs Node.js on macOS using the Homebrew package manager. Node.js is a JavaScript runtime built on Chrome's V8 engine, used to develop server-side applications and command-line tools. Running brew install node installs the latest stable version of Node.js through Homebrew.

Why did running this command install so many other packages?

When you run brew install node, Homebrew automatically resolves Node.js's dependencies and installs them. These dependencies may include compilers, libraries, and other packages needed for Node.js to work properly. That's why you may see other packages being installed. Installing these packages to meet Node.js's runtime requirements is normal behavior. You can check the installation logs or run brew info node for more details about the other packages installed during the process.

Can I specify which version of Node.js to install?

Yes, you can install a specific version of Node.js using Homebrew. Use the following command to list the available Node.js versions:

brew search node

Then, use the following command to install a specific version of Node.js:

brew install node@

Replace the version placeholder with the version number you want to install. For example, to install Node.js version 14.15.1, run:

brew install node@14.15.1

Note that installing different versions of Node.js may leave multiple versions on your system. You can use node -v to check the version currently in use and brew unlink node to switch to a different version of Node.js.

Last updated 2024-01-14

Related posts

Comments 0