Skip to content

pnpm install with workspaces causes duplicate modules #2443

@j

Description

@j

I have multiple workspaces and the library projects use peerDependencies and devDependencies, then the main app that imports the workspaces is in charge of getting the peerDependency.

I came across an issue where a few libraries I use store metadata within it's own module, and moduleA/node_modules/@nestjs/graphql is different than moduleB/node_modules/@nestjs/graphql when they point to the exact version in the package.json.

When I dig into the node_modules/.pnpm/registry.npmjs.org/@nestjs/graphql, I'm seeing two folders there.

.../graphql
       7.1.1_7dada01....
       7.1.1_3zDda0z....
```

Both are identical.  What causes this?

I ended up going through and randomly removing stuff and deleting my locks, etc, did an install and somehow it's fixed, but I want to know exactly why this happens so I can avoid it the next time it comes about?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions