#@nestjs/typeorm brings typescript even npm i --production flag
1 messages · Page 1 of 1 (latest)
@nestjs/typeorm does not have typescript as a dependency, so it's not the reason you have typescript in production: https://github.com/nestjs/typeorm/blob/master/package.json#L52
I also checked the package.json, indeed typescript is in devDependencies, but you can generate the issue by going through the steps below:
- git clone https://github.com/nestjs/typescript-starter.git .
- npm i @nestjs/typeorm
- rm -rf node_modules
- npm i --production
- du -sh node_modules/* | grep 'typescript'
which version of NPM are you using?
Looks like typeorm depends opn ts-niode which depends on typescript. This is a problem with typeorm, not @nestjs/typeorm
npm is resolving the peer dependency automatically, which is why this is happening btw
oh right because it's not a hard dep
Thank you for finding the root cause. Is it the issue on typeorm or ts-node?
both are fine
it's a NPM issue
yarn install --production went fine. No typescript on my node_modules
even npm install --omit=dev --omit=peer still installs typescript
idk how to ignore that peer then
Npm will automatically install peer deps if they're not already installed and not marked as optional in peerDepemdenciesMeta
what is the root cause in this case? There is no issue with NestJS starter kit.
I do not know here to raise the issue.
to me, everything is fine from the PoV of those packages
the "issue" is the current behavior of NPM, see https://github.com/npm/npm/issues/6565
I assume TypeORM really need TypeScript in peerDependencies. Regardless I may better off switching to a different module such as Prisma or Sequlize as TypeORM is not well-maintaned (so many issues on GitHub)
Yep, typeorm is a hot mess