Closed virtualandy closed 11 years ago
Hi @virtualandy, I am afraid there isn't an easy out-of-the-box way how to achieve that.
What you can do:
Clear your npm cache:
$ rm -rf ~/.npm
Create a dummy folder and install all modules you would like to have in your mirror
$ npm install express
$ npm install socket.io
#(etc.)
Upload all tgz files from your ~/.npm
cache into reggie (note you have to do a recursive find). Something along these lines (I didn't test it myself):
for f in `find ~/.npm -name '*.tgz'`; do
# extract name/version from the path
NAME_VER = `echo $f | sed 's/^.*\/\([^\/]*\)\/\([^\/]*\)\/package.tgz/\1\/\2/'`
# upload via PUT request to the reggie server
curl -T $f http://reggie-server:port/package/$NAME_VER
done
OK, that's easy enough. Thanks, we'll have to give this a shot at some point and see how it goes. Thanks for working on reggie, I think something like this is going to be a must-have for some Node users (hence why StrongLoop just pub'd this). :)
We've been struggling to get a full blown npm repo running in a private environment (not to mention, we don't really need all those modules...).
If we give reggie a shot, how could we preload a bunch of modules (say, express, socket.io, underscore, mongodb, etc) into reggie so that we could install from them as well. Worst case we could map registry.npmjs.org to our.local.reggie or something.