Replies: 2 comments 3 replies
-
Hi jpowers, The issue you're experiencing with the "stream is not readable" error is happening because your middleware is consuming the request stream (by reading I recommend implementing a storage plugin rather than middleware. A storage plugin is the most appropriate solution as it's specifically designed to handle I/O actions for metadata and tarballs in Verdaccio. The issue with the middleware approach is that it consumes the request stream, making it unavailable for the subsequent middleware that needs to store the package, resulting in the "stream is not readable" error. With a storage plugin, you can implement the You can create a storage plugin using Verdaccio's plugin generator: npm install -g yo generator-verdaccio-plugin
yo verdaccio-plugin Then select the "storage" plugin type when prompted. |
Beta Was this translation helpful? Give feedback.
-
Take a look at |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I’d like to build a plugin that gets executed when a package is published and gets access to the package tarball. This plugin would then extract the files and POST some of the contents to a different API. Would this be best accomplished by a storage plugin or middleware? Or maybe something entirely different. I’ve tried middleware but get the error
error: stream is not readable
. Here is my simple attempt at doing this with a middleware plugin. The issue is the next() internal PUT middleware can no longer access the req stream and store the package.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions