Here are the steps to install Node.js on a Mac:
1. Visit the Node.js official website:
Open the Node.js official website.
2. Choose a version:
The website will display the latest stable version and the long-term support (LTS) version such as below picture. Depending on your needs, select a version. In general, choosing the LTS version is a good option.
![](https://img.haomeiwen.com/i3707284/8b1650247e9c3a24.jpeg)
3. Run the Node.js installer:
Once the download is complete, run the downloaded installer.
4. Verify the installation:
After installation, you can verify if Node.js and npm were installed successfully by typing the following commands in the Terminal:
node -v
npm -v
If everything is set up correctly, these commands will display the installed versions of Node.js and npm like below picture.
![](https://img.haomeiwen.com/i3707284/f923541badb41060.png)
Now, you have successfully installed Node.js. If you need to globally install Node.js modules later on, you can use the npm command.
I hope this helps! Feel free to ask if you have any further questions.
网友评论