Publishing node modules to a private repository


This is a tutorial on how to use your own private repository to publish node modules to. In most cases this will be a CouchDB based proxy of the public npm registry like Sinopia. I assume that is already set up and all you need is to configure your local development machine to use that registry. Publishing your first package 1) Set your npm config to point to your private repo. npm set registry http://your-private-repo:4873/ npm set always-auth true npm adduser The last command (adduser) will prompt you for the username, password and email. 2) Go to the location of files you want to be included in your package and make sure you have a valid package.json there. You may also add .npmignore file to exclude some files from being part of your package (i.e. unit tests). node_modules folder is automatically ignored but it won’t hurt to add it just in case. Remember to add the publishConfig property. 3) (optional) If you’re publishing the first version of your package, use npm pack to... more

Tags: node, publish, private