Home > Web Front-end > JS Tutorial > body text

How to install node.js on mac

藏色散人
Release: 2021-12-07 15:18:00
Original
20209 people have browsed it

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
Copy after login

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

Enter the following command

npm -g install npm
Copy after login

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)"
Copy after login

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

brew -v
Copy after login

If the version information appears, the installation is successful.

2. Install node.js

Run the following command in the terminal:

brew install nodejs
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template