Publishing all dependencies to local npm registry

389 Views Asked by At

I would like to create local npm registry with sinopia and then publish there all packages from my projects node_modules directory. Effectively I want to be able to run npm install --registry="http://localhost:4873" in my project offline and get all the needed dependencies from local registry. Is there a simple way of doing this?

1

There are 1 best solutions below

1
On

sinopia will cache registries that it pulls from npmjs.org by default.

If you set up your registry to use your sinopia one, then do a clean npm install (delete node_modules prior to running it) through it (while sinopia is connected to the internet), it should pull down all of the packages from npmjs.org and cache them.

After that, subsequent calls with sinopia disconnected should use the one it has cached locally and work as intended.