NPM private deploy the package to a private warehouse
1. Deploy the project to NPM
2. private warehouse to build
a project to deploy NPM
registered NPM account
registered address: https: //www.npmjs.com/
Once registered to enter the email address Verification
Account login
npm login
Login with success
npm who am i
authenticating
Npm library initialization
nPM heat
Followed enter parameters, wherein the required version, as the last generation pagkage FIG.
Write a test file at the same level pagkage outward expose interfaces
At this point, a npm package created
NPM issued a total package
npm publish
After successfully posted, in their NPM following Web site will be able to see the corresponding package npm
Note: Each npm's name is unique, the same name can cause failed to publish
2, create a private warehouse
Internet to find a lot of ways, did not engage in success, in fact, build private npm words is actually very simple, there is a project called sinopia on github, fairly simple to use, no configuration database. Also it can be built with private npm Ali cnpm, but the configuration little more trouble.
Installation sinopia
npm install -g sinopia
After successful installation, change the path for the local npm,
npm set registry http://localhost:4873/
$ npm set ca null
If you use HTTPS, add the appropriate CA Information, ( "null" indicates the operating system to obtain a list from CA)
Adding new users
npm adduser --registry http:// localhost:4873 /
Then you can publish and download their pleasant private npm package
Reference:
1.https: //github.com/rlidwka/sinopia
2.http: //www.cnblogs.com/sghy/p/6829747.html
Original: https: //blog.csdn.net/nanguabushuohua/article/ details / 71486184