Node. js Package Manager:

Source: Internet
Author: User

Node. js Package Manager:

When we are going to take a package as part of the project run, get it through local mode, if you want to use it at the command line, use global mode to install
Packages installed using global mode are not available directly in JavaScript files with require because require does not search/usr/local/lib/node_modules/
Create Global Link: NPM link (Windows does not support NPM link)
Its function is to create symbolic links between the local package and the global package, for example, we have installed Express via NPM Install-g Express, when the project
Directory, Run command: NPM Link Express we can find in the node_modules subdirectory a symbolic link to a package installed in the global
method, we can use the global package as a local package

The release of the package:
NPM Init can produce a standard package.json based on interactive questions and answers.
This generates a NPM-compliant Package.json file in the Byvoidmodule directory, creating a index.js as the interface for the package, and a simple package to make
Completed the

Before the release, you also need to obtain an account for future maintenance of their own packages, using NPM AddUser prompted to enter the user name, password, mailbox, waiting for account creation to complete

Next, run NPM publish in the Package.json directory and wait a few moments for the release to complete.
Open a browser, visit: http://search.npmjs.org. You can find the package you just released, and now we can use it on any computer in the world.
The NPM install byvoidmodule command installs it.

If your package will be updated in the future, simply modify the version field in the Package.json file and then re-use the NPM Publish command on the line if you have
Published packages are not satisfied, you can use the NPM unpublish command to cancel the installation

Node. js Package Manager:

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.