-
I've had a few number of issues with deps lately in my pnpm monorepo, so i'm trying to dive a bit deeper to understand whats going on, and taking the issue below to do so. For background; i'm on the latest pnpm (9.12.1 and have tried older), using a monorepo. My workspace file is as follows (and the project i'm working on rn is packages:
- 'pipeline'
- 'frontend'
- 'backend'
- 'packages/*' Today, i got this error while running a test:
Ok - so where is @aws-sdk/core? My cwd is /backend, so i check backend/node_modules: (base) ➜ backend git:(oct7-pdfs) ✗ ls node_modules/@aws-sdk
client-dynamodb client-s3 client-ses client-sts util-dynamodb
client-eventbridge client-secrets-manager client-sso-oidc lib-dynamodb Hmm - this seems odd. From how i understand packages that are dependencies should always show up at the root, and be (soft) symbolically linked in. Probably doesn't matter much - the above search within lib-dynamodb isn't in the backend dir anyways, its in the root node_modules. So lets take a look in there: (base) ➜ backend git:(oct7-pdfs) ✗ ls ../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@aws-sdk
client-dynamodb lib-dynamodb util-dynamodb Ok, sure enough, its not there either. Which perhaps isn't a huge surprise, because @aws-sdk/core is not listed as a dependency of lib-dynamodb - it is of client-dynamodb. https://github.com/aws/aws-sdk-js-v3/blob/main/lib/lib-dynamodb/package.json So how then do all these nested upon nested deps get resolved? This is where my understanding breaks down. For the record there are seemingly a zillion references to different versions of @aws-sdk/core in my lock file, so i suspect this and me recently adding a gargantuan lib (cough cough llamaindex) isn't helping me here. And the kicker; the only workaround i currently have for this is to install @aws-sdk/core in the workspace root 😭. It feels like something is broken in my setup as all this should just work, so any tips to fill in my understanding or where to look next would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Why would you think otherwise? I mean, it's not immediately clear from your terminal output that
You have correctly identified the root cause of the issue here –
It appears that To sum up, the issue you were having has little to do with pnpm per se; rather, it is caused by |
Beta Was this translation helpful? Give feedback.
Why would you think otherwise? I mean, it's not immediately clear from your terminal output that
node_modules/@aws-sdk
is not a symlink. In fact, it probably is. To find out for yourself, while insidebackend
,…