Node.js installation tutorial

PHPz
Release: 2023-04-26 09:46:30
Original
646 people have browsed it

Node.js is an open source JavaScript runtime platform based on the Chrome V8 engine that can run JavaScript code. It can be used for both server-side and client-side development. This article will introduce how to install Node.js on Windows and Mac OS platforms.

Installing Node.js under Windows

1. Download the Node.js installation package

Download the latest from the Node.js official website (https://nodejs.org/) Node.js installation package, choose the version according to your computer operating system. Generally, you can choose the LTS stable version to download. After the download is completed, double-click the installation package to open it, and the following interface will appear:

2. Install Node.js

Click "Next" to enter the installation path selection page, where you can change the installation path of Node.js. Generally, the C drive is selected by default, and then click "Next". The next page appears, select the additional features you want to install, and click "Next".

3. Set environment variables

After Node.js is installed, we need to set environment variables. In the Windows operating system, we need to add the installation path of Node.js to the system environment variable before we can use the Node.js command in the terminal.

Right-click "My Computer" and then click "Properties";

Click "Advanced System Settings";

Click "Environment Variables" in the lower right corner;

Find the "Path" variable in "System Variables" and click "Edit";

In the interface for editing environment variables, click "New", then enter the installation path of Node.js, and click "Sure".

After the installation is completed, enter node -v in the command line. If the version number of Node.js appears, the installation is successful.

Installing Node.js under Mac OS

1. Download the Node.js installation package

Download from the Node.js official website (https://nodejs.org/) The latest Node.js installation package, the version you choose depends on your computer operating system. Generally, you can choose the LTS stable version to download. After the download is completed, double-click the installation package to open it, and the following interface will appear:

2. Install Node.js

In Mac OS, we can simply drag and drop the installation package to "Applications" Install in, then open "Terminal" and enter node -v. If the version number of Node.js appears, it means the installation is successful.

In Mac OS, we can use the Homebrew package manager to install Node.js.

First you need to enter the following command in the terminal to install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install /master/install)"

After the installation is complete, enter the following command to install Node.js:

brew install node

After the installation is complete, enter node in the terminal - v. If the version number of Node.js appears, it means the installation is successful.

Summary

This article introduces how to install Node.js on Windows and Mac OS platforms. Under Windows, you need to download the Node.js installation package. After the installation is complete, set the environment variables. On Mac OS, you can simply drag and drop the installation package to "Applications" for installation, or you can use the Homebrew package manager to install Node.js. The installation of Node.js is relatively simple. After the installation is completed, you can enter node -v on the command line to verify that the installation is successful.

The above is the detailed content of Node.js installation tutorial. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!