-
Notifications
You must be signed in to change notification settings - Fork 655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to use sinopia in environment with no internet? #98
Comments
Yes, it is possible. If you remove all uplinks from config.yaml, sinopia won't even attempt to connect any internet servers, and will still work fine. But you need to have all dependencies there somehow. Easiest way would be to install sinopia to computer with internet connection, install them (so they would be cached), and then copying the entire installation to a computer with no internet connection. If you look inside storage, it's all just flat files you can move across different computers. You also can publish each dependency manually, or use |
Thanks! Op woensdag 6 augustus 2014 heeft Alex Kocharin [email protected]
|
Hi, I copied the full repo (which was on a mac) to a linux pc (with no internet connection). I removed the uplink (and the proxy) but for some dependencies I get a 500 internal server error: Error: ETIMEDOUT If I check the repo on my mac the particular dependency only has a package.json with a url to a tarball. I would expect that sinopia download the tarball already so it would be next to the package.json?!? |
It's probably because this particular tarball was never downloaded before, so it doesn't exist in the cache. You have to add it then somehow. Maybe running "npm install" multiple times will help, sinopia could mark this version as unreachable and fall back to an earlier one. Not sure about this though. But there is no way to "mirror" npm registry right now. We could write a tool I suppose. |
I wrote a small script to download all missing tarballs to the storage folder (it takes the latest dist file from the package.json). |
So glad for this thread! I was running into a similar problem as I will have no internet. Thanks @njenia as I will test out your script and the other suggestions in this thread. |
@ralberts The script is useful if you want all of the versions of relevant packages. But if you want to get a specific version of a package (and all of its dependencies) I found out that cleaning caches (of npm and sinopia) does the trick. It will get one tarball per each package, which is enough if you want only that specific version of a package. |
@rlidwka quick question if I may. I will have a VM with internet access running sinopia, but I don't want it to go out to the internet for packages, basically always using the local cache. I've removed all uplinks, but sinopia still goes out to registry.npmjs.org to download packages. Even if I make the uplink unusable (by making up a hostname that doesn't exist), sinopia will always fall back to contacting registry.npmjs.org for packages. Thanks a lot
|
There is no such fallback. But it is possible that sinopia already fetched the metadata for some of the packages and stored information like "[email protected] is located in registry.npmjs.org" for the particular versions of those packages. Please check storage directory for sinopia and remove any unwanted packages from there. |
As a complement to @njenia 's app, I also wrote a small tool that rewrites the storage files so the repository latest becomes the latest locally cached version in the storage. This is for avoiding downloading new versions if you already got the ones you needed. Hope it helps. |
I'm interested if it is possible to set up a private repo (sinopia) which has no connection to internet (policy)? Currently we pack our node_modules in a tar file and put them in SVN. Every build we unpack this tar. I tried to npm publish it to sinopia but it doesn't publish it's dependencies with it. Do I need to write a shell script which walks through the directories (of the dependencies) and search for a "node_modules" dir with a package.json and then do a npm publish every time?
I'm quite a newbie on all this...
The text was updated successfully, but these errors were encountered: