-
Notifications
You must be signed in to change notification settings - Fork 3k
Package file size limit #12750
Comments
There's not a hard limit, but since the whole package tarball is serialized into a single Base64-encoded string before being sent to the registry, there's an effective limit that depends on the memory available to the CLI process. Also, it can take a long time to send to the registry, which for some publishers and some registries, including the primary registry, can lead to timeouts. If you're encountering timeouts and not crashes due to memory exhaustion, @npm/registry-team is working on bumping up the timeouts across our registry architecture. You may want to take this question to If you're encountering out of memory errors, you might want to use a beefier host to publish. 10MiB package tarballs shouldn't need more than ~100MiB free RAM for publishing (building big strings in memory is not super economical with V8), so unless you're publishing from a small droplet or a RasPi you should be fine. Speaking prescriptively for a moment, a 10MiB package is big, but not unreasonably so. 20MiB is starting to push it. Practically speaking, much larger than about ~120MiB just isn't going to work for either clients or back end services, and should be avoided / broken down into smaller packages. We'd very much like to convert the internals of npm to be streaming whenever possible to get around this, but the current size caps are known, so this is somewhere between a design limitation / bug and a feature request to address, and there's no particular timeframe in which the CLI team might get to it. I'll leave it you you to decide when to resolve this issue. Good luck! |
It seems that it's failing because of unstable internet connection. When I tried it on our office it works like a charm! |
With Cordova now utilizing npm for the publishing of plugins, there is the possibility of packages easily exceeding 20MB. I'm currently writing a plugin that contains a couple iOS static libraries to add support for interopping with some native 3rd party SDKs. Currently the size of my plugin is 37MB, primarily due to the static libraries. Going forward, as I add support for other platforms such as Android, I can foresee this package easily hitting the 100MB mark. I've hit the size limit before (accidentally), so I'm worried about hitting it again as my plugin increases in size. That being said, in this context, over 20MB doesn't seem unreasonable. However, do you think that large Cordova plugins would be better off residing in a GitHub repository rather than being published to a package provider via npm? |
Due to the limitation of base65 encoded string, I cannot publish a 300mb prebuilt packages in private repo. I do hope we can remove this limit or I have to seek for another deployment tool. |
@stanleyxu2005 I'm facing the same dilemma. Have you figured out an alternative? |
@xaviergmail Well, I gave up the idea of publishing huge package. |
I am also facing the same issue. Looks like this is going to be a pain. |
Since I run a private registry using Verdaccio, I decided to just scp the tarball over. It's a disgusting hack, but it downloads fine afterwards! |
hello. |
What helped me to publish a ~90 MB package :
And it took 4.5 minutes |
Is there any limit on how big the package is? I tried to publish package with a size of 10+ mb and failing.
The text was updated successfully, but these errors were encountered: