NPM private package deployed to private warehouse

Source: Internet
Author: User
NPM Private package deployed to private warehouse 1. Project deployment to NPM 2. Construction of private warehouses 1, project deployment to NPM Register for NPM account

Registered Address: https://www.npmjs.com/
After registration, enter the email verification account login

  NPM Login

Log in for success

NPM Who am I

For verification, the following diagram is successful
Initialize NPM library

Then enter the appropriate parameters, where version is required, and the last generated pagkage is shown below

Write a test file at the Pagkage peer, exposing the interface outward

At this point, a NPM package was created to complete the release of the common NPM package

NPM Publish

After a successful release, you can see the NPM package below your NPM website

Note: The name of each NPM is unique and will cause publishing to fail 2, creating a private warehouse

On the internet to find a lot of ways, have not succeeded, in fact, building a private npm is actually very simple, on GitHub, there is a project called Sinopia, the use is quite simple, no need to configure the database. Ali's cnpm can also be used to build private NPM, but the configuration is slightly more troublesome. Installing Sinopia

NPM install-g Sinopia

After the installation succeeds, modify the NPM path to local,

NPM Set Registry http://localhost:4873/
$ NPM Set CA null

If you are using HTTPS, add the appropriate CA information ("Null" means getting the CA list from the operating system)

Add New User

NPM adduser--registry http/localhost:4873/

Then you can happily publish and download your own private NPM package.

Reference:
1.https://github.com/rlidwka/sinopia
2.http://www.cnblogs.com/sghy/p/6829747.html

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.