- 最新
- 最多得票
- 最多評論
The error you're encountering is related to a known limitation in AWS CodeArtifact for npm package publishing. While CodeArtifact has an asset file size maximum quota that can be increased through a quota request, there is a specific limitation for npm packages that cannot be bypassed:
The maximum size of a publishing request for npm packages is 2 GB. However, this is not the only limitation at play in your case. In npm publishing requests, package metadata and the content of the npm package tar archive are bundled together, and there appears to be a string length limitation of 20 million characters that's causing your error.
This string length limitation is separate from the overall asset size quota and is likely related to how CodeArtifact processes the npm package data internally.
For your specific issue with large sourcemaps, here are some recommended approaches:
-
Exclude sourcemaps from your published package by modifying your build configuration or adding them to .npmignore
-
Split your package into smaller, more manageable packages
-
Consider using source map optimization tools to reduce their size before publishing
-
If you need to keep the large files, you might need to continue using Nexus or another repository solution that doesn't have the same string length constraints
Unlike Lambda functions (which have a hard 250 MB unzipped size limit), CodeArtifact's general asset size quotas can be increased, but this specific npm string length limitation appears to be a fixed constraint in how CodeArtifact processes npm packages.
The error you're seeing is not directly related to the overall package size but rather to how npm packages are processed during publishing to CodeArtifact.
Sources
Packages overview - CodeArtifact
Unzipped size must be smaller than 262144000 bytes | AWS re:Post
Quotas in AWS CodeArtifact - CodeArtifact
相關內容
- 已提問 3 個月前

Is there any official AWS documentation that points to this particular string length limitation