Home  >  Article  >  Web Front-end  >  How to install node.js on mac

How to install node.js on mac

藏色散人
藏色散人Original
2021-12-07 15:17:1520216browse

How to install node.js on mac: 1. Visit the nodejs official website; 2. Download the corresponding ".pkg" file; 3. Double-click the ".pkg" file and install it according to the default steps.

How to install node.js on mac

The operating environment of this article: macOS10.15 system, nodejs version 10.13.0, macbook pro 2020 computer.

How to install node.js on mac?

I have no nodejs foundation, just record it.

Download nodejs

Visit the nodejs official website (https://nodejs.org/en/) and select the appropriate one. I chose mac
How to install node.js on mac

Double-click Just download the .pkg file. After opening it, follow the steps to install it by default. How to install node.js on mac

You must check it after the installation is completed. Open the terminal and enter:

node-v   
npm -v

Because when installing node, Comes with npm.
If version information appears, the installation is successful.

Enter the following command

npm -g install npm

Update npm to the latest version.

This is a method to download node, and another method is to use the command

This method I refer to other people's blogs when installing vue

1. Install brew

Open the terminal and run the following command:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then check whether the installation is successful and enter the following command:

brew -v

If the version information appears, the installation is successful.

2. Install node.js

Run the following command in the terminal:

brew install nodejs

After the installation is successful, check the version information of node.js.

Recommended learning: "nodejs video tutorial"

The above is the detailed content of How to install node.js on mac. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn