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.

Prisma generate script throws error

See original GitHub issue

When I’m trying to run this example: https://github.com/prisma/prisma-examples/tree/master/typescript/graphql-auth

I’m getting the following problem. When running npm i I get this error:

> @prisma/client@2.0.0-preview025 postinstall /Users/yan/Projects/prisma-examples/typescript/graphql-auth/node_modules/@prisma/client
> node scripts/postinstall.js

Error: ENOENT: no such file or directory, mkdir

... Skip lines. Everything is ok here ...

> prisma2 generate

Error: ENOENT: no such file or directory, mkdir
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! graphql-auth@ generate:prisma: `prisma2 generate`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the graphql-auth@ generate:prisma script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yan/.npm/_logs/2020-03-31T06_04_32_492Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! graphql-auth@ generate: `npm run generate:prisma && npm run generate:nexus`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the graphql-auth@ generate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yan/.npm/_logs/2020-03-31T06_04_32_519Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! graphql-auth@ postinstall: `npm run generate`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the graphql-auth@ postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yan/.npm/_logs/2020-03-31T06_04_32_556Z-debug.log

and here is the above mentioned log file contents:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'generate:prisma'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v13.7.0
4 verbose run-script [ 'pregenerate:prisma', 'generate:prisma', 'postgenerate:prisma' ]
5 info lifecycle graphql-auth@~pregenerate:prisma: graphql-auth@
6 info lifecycle graphql-auth@~generate:prisma: graphql-auth@
7 verbose lifecycle graphql-auth@~generate:prisma: unsafe-perm in lifecycle true
8 verbose lifecycle graphql-auth@~generate:prisma: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/yan/Projects/prisma-examples/typescript/graphql-auth/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/yan/Projects/prisma-examples/typescript/graphql-auth/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/yan/Projects/prisma-examples/typescript/graphql-auth/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle graphql-auth@~generate:prisma: CWD: /Users/yan/Projects/prisma-examples/typescript/graphql-auth
10 silly lifecycle graphql-auth@~generate:prisma: Args: [ '-c', 'prisma2 generate' ]
11 silly lifecycle graphql-auth@~generate:prisma: Returned: code: 1  signal: null
12 info lifecycle graphql-auth@~generate:prisma: Failed to exec generate:prisma script
13 verbose stack Error: graphql-auth@ generate:prisma: `prisma2 generate`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:321:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:321:20)
13 verbose stack     at maybeClose (internal/child_process.js:1026:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid graphql-auth@
15 verbose cwd /Users/yan/Projects/prisma-examples/typescript/graphql-auth
16 verbose Darwin 19.0.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "generate:prisma"
18 verbose node v13.7.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error graphql-auth@ generate:prisma: `prisma2 generate`
22 error Exit status 1
23 error Failed at the graphql-auth@ generate:prisma script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I tried to remove node_modules and install again with no luck.

Any ideas?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
aarjancommented, May 23, 2022

I had this issue in my docker container. Mine was fixed by changing the ownership of the node_modules/.prisma folder from root to the default one.

Can you please elaborate on this @aarjan ?

I changed it from root to node chown -R node_modules/.prisma node:node

2reactions
RussMax783commented, Apr 10, 2020

@timsuchanek I’m running into this same issue on the the 2.0.0-beta.2 version, but not locally. I went to deploy the upgrade on AWS Elastic Beanstalk and started getting this error. The version I had previously deployed was preview021 and it worked just fine. I’ve been trying to track down if there are permissions issues or something but am having no luck. I totally get that there are a million use cases and build environments to consider so I’m not expecting anyone to know and fix my problem. Just wanted to update that there are probably a lot of other use cases where this will cause problems.

image

Whats interesting to me is that i see those logs, and then the failure. I’m not sure how to provide more information on this bad boy. But I’m happy to answer questions and help dig into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling exceptions and errors (Reference) - Prisma
The following example tries to create a user with an already existing email record. This will throw an error because the email field...
Read more >
prisma generate throws TypeError: collection is not iterable
I'm using typescript w/ prisma and when I try to run prisma generate , it keeps throwing TypeError: collection is not iterable. at...
Read more >
How to Get Started with Prisma ORM for Node.js and ...
js framework and PostgreSQL database. We will build a simple Quotes REST API to add and serve up programming-related quotes. Let's get started!...
Read more >
How to Build a Node.js Database using Prisma and SQLite
"Prisma helps app developers build faster and make fewer errors with an ... npm init -y $ npm install prisma typescript ts-node @types/node ......
Read more >
How to solve the `prisma/client did not initialize yet` error on ...
Error : @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again. The database was already initialized from...
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