I am using TypeScript and creating an API using nestjs and typeorm. Some of the modules in the project are made reusable by extracting them into its own node module. This is causing the Repository type in the external module to not be the same type as the Repository type inside the original package. So when using the external module I get the error
Argument of type 'import("/Users/user/project/node_modules/typeorm/repository/Repository")
.Repository<import("/Users/project/src/user/user.entity").User>'
is not assignable to parameter of type
'import("/Users/user/my-module/node_modules/typeorm/repository/Repository")
.Repository<import("/Users/project/src/user/user.entity").User>'.
The typeorm package is listed as a peerDependency in the node package so it should always be the same.