Home  >  Article  >  Web Front-end  >  nodejs installation tutorial

nodejs installation tutorial

王林
王林Original
2023-05-14 12:30:37532browse

As Javascript becomes more popular and popular, Node.js is also becoming more and more popular. Node.js is an open source, cross-platform runtime environment that can run Javascript on the server side. It was created by Ryan Dahl in 2009 and is currently managed and supported by the Linux Foundation.

Now, many people want to learn Node.js technology, but they don’t know how to install Node.js. In fact, installing Node.js is very simple. In this article, we will provide a complete installation tutorial for Node.js.

Before installing Node.js, please make sure that Node.js has been installed on your computer. If not, please follow the steps below:

  1. Install Node.js

Download the installation package from the official website: https://nodejs.org/en/download/.

Choose the corresponding version according to your computer's operating system, such as Windows 64-bit or 32-bit system, Linux, etc. Please note that the downloaded file version must match the number of bits of the computer operating system.

Note: If you are a Mac user, you can download the PKG file for your machine from https://nodejs.org/en/download/.

  1. Open the installer

After downloading successfully, run it and the following interface will pop up.

  1. Agree to the installation agreement

Click the "Agree and Continue" button, and you will be prompted to select the installation option for the component.

  1. Select components

In addition to the default Node.js core components, you can also choose to install other optional components.

NPM is a tool for downloading and managing packages, included with Node.js.

Chocolately is a package manager under Windows system.

  1. Select the installation location

The default installation location of the installer is C:Program Files
odejs. If you want to install in another location, please click "Browse" ” button and select your location.

  1. Enable path length limit

The length limit of Node.js internal identifiers and file names is 255 characters. On Windows systems, since the default MAX_PATH is 260, This may cause some files to fail to install. Switch to "Advanced Options", click "Next" and check the "Enable path length limit" option.

  1. Installation completed

The installation program has been completed. Click the "Finish" button to close the installation wizard.

  1. Verify installation

After the installation is complete, we need to verify whether it was installed successfully. Enter the following information in the command line:

node -v

If you successfully installed Node.js, you will get its version number.

v12.16.3

Now, you are committed to Node.js development! Welcome to its world, which will allow you to develop more powerful, flexible, and efficient programs.

The above is the detailed content of nodejs installation tutorial. 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
Previous article:Install nodejs downgradeNext article:Install nodejs downgrade