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.
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.
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.
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.
Copy the Node.js installation directory to the machine that requires offline installation.
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.
Enter node -v on the command line. If the version number is output, Node.js is installed successfully.
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!