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.
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.
Visit the nodejs official website (https://nodejs.org/en/) and select the appropriate one. I chose mac
Double-click Just download the .pkg file. After opening it, follow the steps to install it by default.
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 method I refer to other people's blogs when installing vue
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.
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!