Home > Article > Web Front-end > How to install nodejs on Mac
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
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:
This means the installation is successful. Now enter npm -v in the terminal. If the version number comes out as shown below:
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:
#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!