Reputation: 91
i was use Verdaccio which is a lightweight private npm proxy registry built in Node.js
when i publish my code to verdaccio ,it always have a Error:
the logs file key word: 15 notice === Tarball Details === 16 notice name: canwin-viewer3d 16 notice version: 1.0.0 16 notice package size: 21.9 MB 16 notice unpacked size: 50.4 MB 16 notice shasum: 63d555be03e0c7a7b6dcdfb662d29c48b21d8c53 16 notice integrity: sha512-KFz0gTPJusdfV[...]VIeII6rrcv4IA== 16 notice total files: 733 17 notice 18 http fetch PUT 413 http://localhost:4873/canwin-viewer3d 677ms 19 verbose stack Error: 413 Payload Too Large - PUT http://localhost:4873/canwin-viewer3d - request entity too large 19 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:104:15 19 verbose stack at processTicksAndRejections (internal/process/task_queues.js:97:5) 20 verbose statusCode 413 21 verbose pkgid [email protected] 22 verbose cwd C:\work\viewer3d 23 verbose Windows_NT 10.0.18363 24 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "publish" 25 verbose node v13.10.1 26 verbose npm v6.13.7 27 error code E413
it seems that the PUT Quest PayLoad was Large ,so i try to find the verdaccio config file,but i have nothing ,verdaccio it code maybe use node express to run ,how can i setting the Put Payload size?
Upvotes: 9
Views: 11140
Reputation: 154
So generally you can face two problems with 413 errors.
npm config set max_body_size 100mb --registry https://<your registry>
values.yaml
...
max_body_size: 100mb
....
If this is a nginx
proxy you can try:
http {
...
client_max_body_size 100M;
}
or if this is a node.js
server you can use the bodyParser
as described in detail in this thread:
var bodyParser = require('body-parser');
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
Upvotes: 8