So I have a need to do some new web development on a standalone box on a standalone network. This standalone network does not have any access to internet, but there are quite a few machines on it that operate in a Windows Server environment.
I have an internet-accessible machine with which I could download node and get the packages, but I need to be able to transfer the packages en masse over to the standalone machine.
What's the best way for doing that? I've read a few docs about replicating the registry on a local machine so it caches it, but how would I take that cache and port it over via usb to this standalone network?
Are there other methods for handling this?
Previously on a different project, we established our own private npm repo using Verdaccio, and published our own npm modules to that repo. I could easily set that up and then port over tar or zip files of node modules and publish them that way. But again the question is, how do I get the bulk of node packages I need?
The main thing I need to know is how to take this locally cached npm registry and set it up on a standalone machine once all the modules are copied. I can do that all on the internet box, but how would I transfer and replicate all on the server?
I have the same problem.
I install and use the verdaccio
and resolved my problem.
thanks to juan picado
what you need is cache properly all dependencies in your storage folder.
see here how to find it
(e.g in windows 8.1
: C:\Users\xxx\AppData\Roaming\npm-cache)
You should be able to see all the resolved dependencies in the cache.
then set Environment variable
with name: XDG_DATA_HOME
in follow path:
Advance system settings
.Advance
Tab click Environmrnt variable ...
button.system variable
group. click new
button.XDG_DATA_HOME
to Variable name
and cache path to Variable value
.Ok
button.now, go to config.yaml
and comment proxy
in packages
section. follow this:
packages:
'@*/*':
access: $all
publish: $authenticated
# proxy: npmjs
'**':
access: $all
publish: $authenticated
# proxy: npmjs
change registry config url.
npm config set registry http://localhost:4873/
finnally, restart verdaccio.
I hope is useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With