question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generator output `client` leads to `Error: ENOENT: no such file or directory, open '.../node_modules/@prisma/client/schema.prisma'`

See original GitHub issue

Bug description

If you set the value of output, the following things will happen. If you do not set, the program is normal。

please help

How to reproduce

i can set output in new version

Expected behavior

Error: ENOENT: no such file or directory, open '/Users/xxx/Program/prisma/node_modules/@prisma/client/schema.prisma'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at new LibraryEngine (/Users/xxx/Program/prisma/prisma/client/runtime/index.js:35468:41)
    at PrismaClient.getEngine (/Users/xxx/Program/prisma/prisma/client/runtime/index.js:40266:16)
    at new PrismaClient (/Users/xxx/Program/prisma/prisma/client/runtime/index.js:40241:29)
    at Object.<anonymous> (/Users/xxx/Program/prisma/src/models.ts:2:16)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Module.m._compile (/Users/xxx/Program/prisma/node_modules/ts-node/src/index.ts:1459:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/xxx/Program/prisma/node_modules/ts-node/src/index.ts:1462:12) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/Users/xxx/Program/prisma/node_modules/@prisma/client/schema.prisma',
  clientVersion: '3.11.0-integration-mobc-fix.1'
}

Prisma information

generator client {
  provider = "prisma-client-js"
  output   = "client". // If not, it is normal
}

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

Environment & setup

  • OS:
  • Mac
  • Database:
  • Mysql
  • Node.js version:
  • 16.8.0

Prisma Version

prisma                  : 3.11.0-integration-mobc-fix.1
@prisma/client          : 3.11.0-integration-mobc-fix.1
Current platform        : darwin
Query Engine (Node-API) : libquery-engine ca9fb922c8fd66aa105fe549629891efc4219ca3 (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine        : migration-engine-cli ca9fb922c8fd66aa105fe549629891efc4219ca3 (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine    : introspection-core ca9fb922c8fd66aa105fe549629891efc4219ca3 (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary           : prisma-fmt ca9fb922c8fd66aa105fe549629891efc4219ca3 (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash    : test-mobc-fix-ca9fb922c8fd66aa105fe549629891efc4219ca3
Studio                  : 0.458.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
janpiocommented, Mar 13, 2022

Thanks. We will treat this as a bug, I updated the issue title to make it easier to understand.

1reaction
xygengcncommented, Mar 13, 2022

Yeath! Using foo instead of client,everything works as expected. @janpio

Read more comments on GitHub >

github_iconTop Results From Across the Web

Yeoman generator error - ENOENT: no such file or directory ...
1 Answer 1 ... I'd recommend searching generators on https://npms.io/search?q=yeoman-generators and try to stay to the generator who're maintained ...
Read more >
Generators (Reference) - Prisma
A generator determines which assets are created when you run the prisma generate command. The main property provider defines which Prisma Client (language ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found