As new technologies continue to emerge and innovative ideas continue to emerge, more and more developers are beginning to use Node.js as their development platform. Therefore, we need to understand how to install Node.js on our own machine to better start developing our ideas.
This article will introduce how to install Node.js (version 14.x) in 2021. The following are the detailed steps of the installation process:
1. Installation conditions
First, we need to confirm whether our computer has the conditions to install Node.js. Node.js can run on a variety of operating systems such as Windows, macOS, and Linux. In addition, we need to ensure that the following tools have been installed on our computer:
2. Download Node.js
We can find the latest Node.js version on the official website https://nodejs.org/en/, we recommend downloading LTS (long-term supported) version for best compatibility and stability.
Select the version you use personally and click to download. The size of the installation package is generally within 20MB, which is very small.
3. Install Node.js
After the download is completed, we can start installing Node.js.
For Windows users:
Double-click the downloaded msi file to enter the Node.js installation wizard. Click "Next" to continue, and then select the installation location and components. It is generally recommended to keep the default settings. Click "Install" to start the installation. After waiting for completion, click "Finish" to exit the installation program.
For macOS users:
Double-click the downloaded pkg file to enter the Node.js installation wizard. Click "Continue" to continue, and then select the installation location and components. It is generally recommended to keep the default settings. Click "Install" to start the installation. After waiting for completion, click "Continue" to exit the installation program.
For Linux users:
If you are running an APT-based distribution such as Debian or Ubuntu, you can install Node.js using the following command (please replace the version number with the one you want to install version number):
sudo apt-get update && sudo apt-get install -y nodejs npm
If you are running a YUM-based distribution such as RedHat, Fedora, CentOS, etc., you can use the following command:
sudo yum install -y nodejs
4. Test whether Node.js is successfully installed
After the installation is complete, we need to test whether Node.js has been successfully installed.
Open a terminal and enter the following command in it:
node -v
If it returns the Node.js version number, Node.js has been successfully installed on your computer.
v14.x.x
In addition, we can also enter the following command for a more detailed version number query:
node --version
If the version number can be listed, it means that Node.js has been successfully installed.
At this point, we have completed the installation of Node.js. Now you can start developing new ideas on your own computer!
The above is the detailed content of idea2018 install nodejs. For more information, please follow other related articles on the PHP Chinese website!