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