Replies: 1 comment 1 reply
-
Try to use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have a monorepo where one of the packages has the following
package.json
:When running
pnpm run pack
, I get a nicearchiver.zip
in the parent folder which I can later use as the source for an AWS lambda layer.I have done this with other packages and it worked fine for all of them, except for the one above where it fails with this message:
This was very surprising to me as the
readable-stream
library is placed inside the hoisted structure just fine.Before using pnpm, I had done a simple export with
npm
and created the zip file manually. This allowed me to spot one difference:lazystream
package folder, there was anode_modules/readable-stream
folder which was now missing from my newly generated zip.Looking at the dependencies, I see two things:
archiver
5.3.0 depends onreadable-stream
version 3.6archiver-utils
depends onlazystream
which hasn't changed in ages and still depends onreadable-stream
version 2.0.5This explains why there was a
node_modules
folder specifically forlazystream
but I could not find an option to be given topnpm
above to replicate this structure when two packages depend on a different version of the same package.I was able to come up with a workaround by using lots of different commands and ended up with this:
But while this fixes my issue, it does not feel very extensible should another dependency need to be "fixed" in a similar way.
As I was not sure this is a bug in
pnpm
itself, I preferred to start a discussion here, but please do not hesitate to let me know if I should move this to the issue tracker.Beta Was this translation helpful? Give feedback.
All reactions