(Almost) all the stuff you need to start running an npm mirror locally on your machine.
DISCLAIMER: I am just automating/packaging parts of the process described in this blog:
Install the tools. We're gonna need these (which hopefully you have already got them):
- Clone the repository
$ git clone git://github.com/chakrit/npm-mirror.git path/you/want/for/mirror $ cd path/you/want/for/mirror
Makefileand change the variables to your liking.
$ cd path/you/want/for/mirror $ nano Makefile
Example of what's provided by default:
ADMIN_USER = admin # local couchdb admin username ADMIN_PASS = mirr0r # password COUCH_HOST = 0.0.0.0 # where you are actually running the couchdb instance COUCH_PORT = 1877 # couchdb port NPMORG_HOST = isaacs.iriscouch.com # source npm registry to clone from NPMORG_PORT = 80 # port
maketo starts up a CouchDb instance.
$ cd path/you/want/for/mirror $ make # CouchDb should have been started running in your terminal window.
make setup(in another terminal) to setup the CouchDb instance.
$ make setup
make replicateto starts the replicating the configured npm registry to your machine.
$ make replicate
This may take a really long time as the CouchDb database is being replicated over to your machine.
You might want to leave this running while you go work on something else.
--registryflag pointing to your local CouchDb install whenever you want to install or publish packages to/from this repository.
$ npm --registry http://localhost:1877/registry/_design/app/_rewrite install yourpackage
- Include CouchDb pre-built?