preface
Read on to recommend a relatively complete solution based on Verdaccio as your development team gets bigger and bigger, or as you get tired of node’s super-slow builds.
For environmental reasons, let’s just go to npmjs.org and forget about it, NPM can be config set registry=https://registry.npm.taobao.org can alleviate some of the, but if you have some company custom NPM package how to share in the company, this time you need a NPM private servers.
What is Verdaccio
Verdaccio is a simple zero-configuration Node.js lightweight private REPOSITORY of NPM agents.
What can Verdaccion do
1. Cache nPMjs.org repository
NPM is known to be slow to install and can be used to reduce latency (roughly “slow” nPMjs.org only connects once per package/version) and provide limited failover (if we fail using nPMjs.org, we can still get the package from the cache)
2. Private warehouses
If you want to use the NPM package system in your company without sending all your code to the public, use a proprietary package just as easily as a public one.
3. Link multiple warehouses
If you use multiple NPM repositories in your organization and need to obtain packages from multiple sources in a single project, you can leverage Verdaccio’s uplink capability to link multiple repositories together and obtain them from a single endpoint.
4. Overwrite common packages
If you want to use a modified version of a third-party software package (for example, if you find an error but the maintainer has not yet accepted the request), you can distribute the version locally using the same name. See here for details.
5. End-to-end testing
Verdaccio turns out to be a lightweight repository that can be launched in seconds, fast enough for any CI. Many open source projects use Verdaccio for end-to-end testing.
Note: Functions 3, 4 and 5 need to be explored by yourself.
The installation
Note: Verdaccio supports a variety of installation methods and even includes a Charts pack
precondition
1. The Node version
- [email protected] Node V6.12 is the lowest version.
- [email protected] or [email protected] Node 8.x (LTS “Carbon”) is the lowest version.
2. npm >=4.x or yarn
Strongly recommend the use of the latest official node package management client > [email protected] | [email protected] | [email protected]
3. The Web interface supports Chrome, Firefox, Edge, and IE11 Browsers.
Docker-compose mode
You can refer directly to our archived version of the portal
It’s time to ditch CNPM and hope you can enjoy Verdaccio.
More and more
-
Please refer to the official Verdaccio documentation
-
To speed up node construction, you are advised to enable multi-phase construction
Refer to the link
-
Medium.com/engenharia-…
-
Verdaccio.org/docs/en/wha…