node package manager


A proxy server built on node-http-proxy for npm to publish packages to a child/private registry and install packages from a child or parent/public registry (if the child doesn't have the package).

Build Status

Deprecation Warning

We ran into a few issues updating our npm repo with newer npm and checkouts.

Newer versions of have different rewrite urls and require a trailing slash, but vhosts should fix these issues.

Around the introduction of the npm-registry-client (version ~1.1.25), npm required couchdb auth credentials for package GET requests (for security reasons I think). We use different credentials for our public and private repos and couldn't naively proxy GET requests to the public anymore.

@wyrdvans fixed these issues by setting up vhosts, replicating the registry and our private registry. This also improved performance on our network, reduced load on the public, made it easier to run security audits on our node dependencies, and removed the need to run this proxy.

Hopefully we can support multiple npm repositories in npm itself instead of needing a fully replicated repo or an npm proxy:


Requires node version 0.6.6 or newer. Untested on node 0.8.


  1. Run
    npm install npm-proxy
  1. Run locally:
    ./bin/npm-proxy --child-registry-target

As a couchdb os process deamon on the child npm registry:

  1. Install npm-proxy globally
    sudo npm install -g npm-proxy
  1. Add the following line to the os_daemons section of /etc/couchdb/local.ini on the child npm registry:
    npm_proxy = /usr/bin/npm-proxy --child-registry-target
  1. Restart couchdb and make sure npm-proxy started with it


Usage: npm-proxy [options]


  -h, --help                                            output usage information
  -V, --version                                         output the version number
  -t, --target [localhost:8080]                         hostname and port to listen on or url
  -c, --child-registry-target [localhost:5984]          NPM registry to push packages and pull from first
  -p, --parent-registry-target []  NPM registry to pull packages from if the child doesn't have it

Once the proxy is running point npm to it using any of the methods from "Using the registry with the npm client" section of the project.


Janky OSX Testing on for my machine:

# brew install couchdb
rm npm-shrinkwrap.json
npm install -d . --registry=
make clean setup-couch
couchdb # start couch
make setup-npmjs
# start npm-proxy
./bin/npm-proxy -c localhost:5984
make acceptance test


  • ANSI colors for log output
  • 100% unit test coverage
  • For acceptance tests, setup and teardown multiple processes using node
  • For integration tests, record and playback npm requests and responses