vegardit / prisma-generator-nestjs-dto

Generates NestJS DTO classes from Prisma Schema
Apache License 2.0
274 stars 76 forks source link

prisma-generator-nestjs-dto: not found #112

Closed JosepAlacid closed 2 years ago

JosepAlacid commented 2 years ago

Hi, I feel excited to find your repository after reading Prisma Generator concepts from Prisma main documents. I've installed the generator using the readme command line: npm install --save-dev @vegardit/prisma-generator-nestjs-dto and added the corresponding generator in my schema.prisma file, but changed the output folder using the output parameter, no other parameters are provided.

generator client {
  provider = "prisma-client-js"
  output   = "../libs/tipus-avismon/src/lib"
}

generator nestjsDto {
  provider = "prisma-generator-nestjs-dto"
  output   = "../libs/tipus-avismon/src/lib"
}

I've started prisma generate but the following error is show:

$ prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: Generator at prisma-generator-nestjs-dto could not start:

/bin/sh: 1: prisma-generator-nestjs-dto: not found

prisma client generator is also in my schema.prisma file and it worked fine.

I've searched in issues and found some information at #16 about the symlink. It is there, but I cannot find node_modules/prisma-generator-nestjs-dto/dist/cli.js in my node_modules folder.

I'm using prisma on a nx (@nrwl/nx) nest/angular monorepo. Maybe this could be involved in the issue. Additional information about environement and versions:

**Prisma:**
   Environment variables loaded from .env
   prisma                  : 3.12.0
   @prisma/client          : 3.12.0
   Current platform        : debian-openssl-1.1.x
   Query Engine (Node-API) : libquery-engine 22b822189f46ef0dc5c5b503368d1bee01213980 (at .../.nvm/versions/node/v16.14.2/lib/node_modules/prisma/node_modules/@prisma/engines/libquery_engine-debian-openssl- 1.1.x.so.node)
   Migration Engine        : migration-engine-cli 22b822189f46ef0dc5c5b503368d1bee01213980 (at ../.nvm/versions/node/v16.14.2/lib/node_modules/prisma/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
   Introspection Engine    : introspection-core 22b822189f46ef0dc5c5b503368d1bee01213980 (at ../.nvm/versions/node/v16.14.2/lib/node_modules/prisma/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
   Format Binary           : prisma-fmt 22b822189f46ef0dc5c5b503368d1bee01213980 (at ../.nvm/versions/node/v16.14.2/lib/node_modules/prisma/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
   Default Engines Hash    : 22b822189f46ef0dc5c5b503368d1bee01213980
   Studio                  : 0.459.0

** Node / OS **

   Node : 16.14.2
   OS   : linux x64
   npm  : 8.6.0

** NX **
   nx : 13.9.7
   @nrwl/angular : 13.9.7
   @nrwl/cypress : 13.9.7
   @nrwl/detox : Not Found
   @nrwl/devkit : 13.9.7
   @nrwl/eslint-plugin-nx : 13.9.7
   @nrwl/express : Not Found
   @nrwl/jest : 13.9.7
   @nrwl/js : 13.9.7
   @nrwl/linter : 13.9.7
   @nrwl/nest : 13.9.7
   @nrwl/next : Not Found
   @nrwl/node : 13.9.7
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 13.9.7
   @nrwl/web : Not Found
   @nrwl/workspace : 13.9.7
   typescript : 4.5.5
   rxjs : 7.5.5

Hope this helps!

JosepAlacid commented 2 years ago

I've checked the node_modules/.bin/prisma-generator-nestjs-dto and it points to: node_modules/@vegardit/prisma-generator-nestjs-dto/dist/cli.js I've tried to copy the prisma-generator-nestjs-dto folder to the root of node_modules, but the error persists.

JosepAlacid commented 2 years ago

It seems a prisma problem. Tried with another community generator and the same error is shown. I'm gonna add an issue to the main prisma repository.

ruanhaodong commented 2 years ago

Use npx prisma generate works for me

benkroeger commented 2 years ago

seems to not be related to this generator. @JosepAlacid please link the issue you created in the main prisma repo