Install Node.js on Mac

Installing Node.js on a Mac can be done with the following steps:

  1. Open the Terminal application.

  2. Use the Homebrew command to install Node.js. Type the following command and press Enter:

brew install node
  1. Wait for a while, and Homebrew will automatically download and install Node.js and its associated packages and dependencies.

  2. Once the installation is complete, you can use the following command to verify that Node.js was successfully installed:

node -v
  1. If you can see the version number of Node.js, it has been successfully installed.

In addition to using the Homebrew command to install Node.js, you can also download the installer from the Node.js official website for installation. Here are the steps to download and install Node.js:

  1. Visit the Node.js official website (https://nodejs.org).

  2. Download the Node.js installer for Mac.

  3. Double-click the downloaded installer and follow the prompts to complete the installation process.

  4. Once the installation is complete, you can use the following command to verify that Node.js was successfully installed:

node -v
  1. If you can see the version number of Node.js, it has been successfully installed.

Whether you install Node.js using the Homebrew command or download the installer from the official website, after the installation is complete, you can use Node.js in the terminal for development and testing.

Guess you like

Origin blog.csdn.net/daxiangaifashi/article/details/130156059