Kill lui lei Dog---Common commands for NPM in node. JS---2node.js

Source: Internet
Author: User

NPM Install <name>

Installing the Nodejs Dependency Package

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

To install a package into a 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

At the same time as the installation, the information is written to Package.json

If you have a package.json file in the project path, you can use the npm install method directly according to the dependencies Configure all dependent packages to be installed . 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 the 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

Kill lui lei Dog---Common commands for NPM in node. JS---2node.js

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.