I just want to share some private NodeJS modules for reuse in my other projects. A simple private registry is a good choice. sinopia is what I used.
The installation is very easy.
$ yarn global add sinopia
$ sinopia &
$ npm set registry http://localhost:4873/
After this, we can add a user to the new registry.
$ npm adduser --registry http://localhost:4873/
Now we need to update the module's package.json
to remove the "private": true
and add following publish config.
{
"publishConfig":{
"registry":"http://localhost:4873"
}
}
Then we can run npm publish
to publish the module. The new published module can be installed using npm
or yarn
in other projects.
Switch to Verdaccio
Verdaccio is a fork of sinopia with better maintenance and documentation.