Home  >  Article  >  Web Front-end  >  How to install nodejs on Mac

How to install nodejs on Mac

php中世界最好的语言
php中世界最好的语言Original
2018-04-28 15:26:312834browse

This time I will bring you how to installnodejs on Mac and what are the notes on how to install nodejs on Mac. The following is a practical case, let’s take a look.

First open node

nodejs

Then you will see the following picture

How to install nodejs on Mac

Click on any of the above to complete the download. After the download is complete, find the file, confirm the fool-proof installation all the way, and then it will be OK.

Let’s test whether the installation is successful: Open the terminal under Mac and enter: node -v If the version number appears, it means success:

How to install nodejs on Mac

This means the installation is successful. Now enter npm -v in the terminal. If the version number comes out as shown below:

How to install nodejs on Mac

This is it.

But after all, npm is still too slow to install some things, so it is recommended that you install cnpm to speed up your software installation. Here are the steps to install cnpm:

sudo npm install - g cnpm –registry=<a href="http://www.php.cn/wiki/373.html" target="_blank">https://</a>registry.npm.taobao.org –verbose The above line uses the Taobao image to install cnpm. If you enter cnpm -v after the installation is complete, the following appears. The content indicates success:

How to install nodejs on Mac

#The basic configuration is completed.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

What steps are needed to determine the type and size of uploaded images

WeChat Mini Program API Encapsulation

The above is the detailed content of How to install nodejs 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