nodejs installation in cmd

WBOY
Release: 2023-05-25 10:50:07
Original
1177 people have browsed it

Node.js is an application running environment based on the Chrome V8 JavaScript engine. It can help developers quickly build high-performance network applications and is an indispensable part of modern web development. This article will introduce how to install Node.js using the command line in Windows systems.

  1. Download Node.js

First, we need to download the latest version of Node.js from the official website nodejs.org. In the download page, we can choose to download LTS (long-term support version) or Current (current version).

Select the system version that suits you in the drop-down list, then click the download button and wait for the download to complete.

  1. Install Node.js

After the download is completed, we need to enter the cmd command line and execute the node -v command to confirm whether nodejs has been installed. If there is no prompt node command not found, it means nodejs is not installed.

Next, we need to enter the path of the Node.js installation package we downloaded in the cmd window and enter the following command to install Node.js:

msiexec /i <node.js-msi-file>
Copy after login

Here indicates the full path of the Node.js.msi file we downloaded, for example:

msiexec /i C:UsersAdministratorDownloads
ode-v14.18.0-x64.msi
Copy after login

Then, we only need to follow the prompts to complete the installation of Node.js. During the installation process, we can choose to customize the installation path and other options, or we can directly install the default settings.

  1. Confirm whether Node.js is installed successfully

After the installation is completed, we need to confirm that Node.js has been successfully installed. Enter the following command in the cmd command line:

node -v
Copy after login

If an output similar to the following appears, Node.js has been successfully installed:

v14.18.0
Copy after login

In addition, we can also enter in the command line The following command is used to verify whether Node.js is working properly:

node
Copy after login

Then enter the following content in the node command line:

console.log('Hello World!');
Copy after login

If "Hello World!" is output, Node.js has been Work correctly.

  1. npm Package Manager

An important feature of Node.js is the npm package manager, which is a tool for publishing and managing Node.js modules. The npm package manager is commonly used to install and manage JavaScript modules, frameworks, and other tools for easy reuse and updates in projects. During the Node.js installation process, the npm package manager is also automatically installed.

In order to confirm whether the npm package manager is working properly, we can enter the following command in the cmd command line:

npm -v
Copy after login

If both Node.js and npm can be installed successfully, then there should be output here npm version information.

  1. Conclusion

Through the above steps, Node.js and npm package manager were successfully installed on the Windows system. In our development projects, we can easily use Node.js for tasks such as creating servers, processing data, creating web applications, and building tools.

The above is the detailed content of nodejs installation in cmd. 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