Home  >  Article  >  Web Front-end  >  How to make Node.js offline installation package

How to make Node.js offline installation package

PHPz
PHPzOriginal
2023-04-17 15:29:45995browse

In the daily development process, we often use Node.js as the back-end development language, but in some special scenarios, we may need to install Node.js offline. This article will introduce how to make a Node.js offline installation package.

  1. Download the Node.js installation package

First you need to download the Node.js installation package from the Node.js official website (https://nodejs.org/en/download /), select the installation package of the corresponding version to download.

  1. Install Node.js

Copy the downloaded installation package to the target machine, double-click to run the installation package to start installing Node.js. Follow the instructions of the installer to complete the installation of Node.js step by step.

  1. Install dependent libraries

In Windows systems, Node.js needs to depend on Microsoft Visual C 2015 Redistributable x64, so the corresponding dependent libraries need to be installed. You can download the corresponding version of the dependent library from the Microsoft official website according to the system version and install it.

  1. Copy the installation directory to the offline machine

Copy the Node.js installation directory to the machine that requires offline installation.

  1. Configuring environment variables

Open the Control Panel, select "System and Security" > "System", and in the right panel, click "Advanced System Settings".

Click "Environment Variables" and click "New" in System Variables.

Enter the variable name NODE_HOME, and the variable value is the path to the Node.js installation directory.

Add the %NODE_HOME%\bin path in the Path of the system variable.

  1. Test installation

Enter node -v on the command line. If the version number is output, Node.js is installed successfully.

  1. Make an offline installation package

Copy the node_modules and lib directories in the Node.js installation directory to a new directory and package them into zip format files. .

This article introduces how to make a Node.js offline installation package. I hope it will be helpful to developers.

The above is the detailed content of How to make Node.js offline installation package. 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