NPM Common commands in Nodejs

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.