In the Nodejs project, use the Package.json file to declare the modules used in the project so that when the new environment is deployed, you can install the required modules as long as you execute the NPM install command in the same directory as the Package.json file.
The items that can be configured in the Package.json file are:names (name)、Application Description (description)、version number (versions)、applied configuration item (config)、author (author)、Resource Warehouse address (repository)、Authorization Method (licenses)、Catalogue (Directories)、Application Portal file (main)、command-line file (BIN)、Application dependent module (dependencies)、Development Environment Dependency module (devdependencies)、run engine (engines)Andscript (scripts)such as
The default is as follows:
{"Name": "Application-name", "Version": "0.0.1", "private": true, "scripts": {"Start": "Node App"}, "Dependenc ies ": {" Express ":" 3.1.0 "," Jade ":" * "}}
The key is the Dependencies node, which configures the list of modules that the application depends on.
Nodejs Package.json