The public npm registry at http://npmjs.org is a common way to publish open-source code. When you have proprietary code, you may also want to set up a private package registry.
Using multiple registries for a single project enables you to easily combine both open-source modules from the public npm registry and proprietary modules from your private registry. You may also want to use multiple private registries, for example a company-wide registry for stable modules and multiple team registries with nightly builds.
Use the slc registry command to easily work with multiple registries. It provides the following sub-commands:
- add - Create a new registry configuration with the given name.
- list - List configured registries.
- remove - Remove the specified registry configuration and related files.
- use - Use one of the registry configurations created with the
- promote - Promote a given package version to another registry.
If you have not already done so, follow the steps Getting started with StrongLoop Controller (tutorial) to install the
slc command-line tool.
Configuring slc to use a private registry
Follow these steps to configure slc to use your private npm registry instead of the public npm registry:
Add a new configuration entry for your private registry:
The configuration wizard will prompt you for configuration options:
Switch your npm client to use the private registry:
To switching back to the public npmjs.org registry use the command:
Promoting a package
Assuming you already followed the steps in the previous section to set up a registry, follow these steps to promote a package from a private to a public registry:
Publish a package to the private registry
Promote a package version to the public registry
For more information, see: