npm Install <name> installation Nodejs Dependency Pack
For example, NPM install Express installs the latest version of Express by default, or you can install the specified version by adding the version number later, such as NPM install [email protected]
npm Install <name>-G packages are installed in the global environment
But in the code, the direct way through require () is that there is no way to call a globally installed package. The global installation is for the command line, as if the Vmarket is installed globally, you can run the VM command directly on the command line
npm Install <name>--save to write information to Package.json
If you have a Package.json file in the project path, you can use the NPM install method directly to install all the dependent packages based on the dependencies configuration
When this code is submitted to GitHub, it is not necessary to commit the Node_modules folder.
NPM init will guide you through the creation of a Package.json file, including name, version, author information, etc.
npm Remove <name> Remove
NPM update <name> update
NPM ls lists all the packages that are currently installed
NPM root View the installation path for the current package
NPM root-g View the installation path for a global package
NPM Help helps, if you want to view the help of the install command separately, you can use the NPM helper install
Help Document: https://npmjs.org/doc/
Reprinted article, original address https://my.oschina.net/robinjiang/blog/168732
NPM Common commands in Nodejs