Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install of Prisma CLI fails on preinstall with no logs when Node.js version is lower than minimum #20260

Closed
Jolg42 opened this issue Jul 17, 2023 · 12 comments · Fixed by #20263
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. team/schema Issue for team Schema. topic: cli topic: node version
Milestone

Comments

@Jolg42
Copy link
Member

Jolg42 commented Jul 17, 2023

I create the project with npx prisma init and uploaded to Render with different error, i link you the github repo to check it out (im using neon.tech as DB provider)

https://github.com/Dominguezd01/PrismaTest

I hope this helps, peace

Originally posted by @Dominguezd01 in #20193 (comment)

@Jolg42 Jolg42 added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. topic: cli topic: node version team/schema Issue for team Schema. team/client Issue for team Client. topic: database-provider/render.com labels Jul 17, 2023
@Jolg42
Copy link
Member Author

Jolg42 commented Jul 17, 2023

@Dominguezd01 I believe your problem here is that you are trying to install Prisma 5 CLI which requires Node.js v16.13 at minimum.

And in your screenshot, it says your deployment is using v14.17
renderError

Could you upgrade your Node.js version? (We recommend to upgrade to v18 when possible).

@Jolg42
Copy link
Member Author

Jolg42 commented Jul 17, 2023

Why this happened?
Because we have this code to check the Node.js version during preinstall:
https://github.com/prisma/prisma/blob/main/packages/cli/scripts/preinstall.js#L9

I think we can keep this issue to see how we can make it better.

@Jolg42 Jolg42 changed the title npm install of Prisma CLI fails on preinstall with no logs npm install of Prisma CLI fails on preinstall with no logs when Node.js version is lower than minimum Jul 17, 2023
@janpio
Copy link
Member

janpio commented Jul 17, 2023

Are we missing the actual error message output there @Jolg42 or is this a Render problem?

@Jolg42
Copy link
Member Author

Jolg42 commented Jul 17, 2023

The "box" seems to be truncated here, but a quick local test show the same 🙈
I'll try a quick fix

npm i
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'prisma@5.0.0',
npm WARN EBADENGINE   required: { node: '>=16.13' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm ERR! code 1
npm ERR! path /Users/j42/Repros/node15/node_modules/prisma
npm ERR! command failed
npm ERR! command sh -c node scripts/preinstall-entry.js
npm ERR! ┌─┐
npm ERR! │   …│
npm ERR! └┘

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/j42/.npm/_logs/2023-07-17T14_21_08_241Z-debug.log

@Jolg42 Jolg42 self-assigned this Jul 17, 2023
@Jolg42 Jolg42 added this to the 5.1.0 milestone Jul 17, 2023
@Jolg42 Jolg42 added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. topic: database-provider/render.com labels Jul 17, 2023
@janpio
Copy link
Member

janpio commented Jul 17, 2023

@Jolg42 created a PR at #20263

Sorry that this is so hidden in Prisma 5 @Dominguezd01. It will be fixed in 5.1.0. Can you upgrade your Node version on Render to Node 16?

@Dominguezd01
Copy link

Okay, changing node version to 16.20.1 and 18.16.1 works fine, my bad, I didnt double check the Node version.
Thanks for the help, if you need something else, ask for it and I´ll try my best 😅

@okechukwu26
Copy link

Aug 27 01:46:17 AM ==> It looks like we don't have access to your repo, but we'll try to clone it anyway.
Aug 27 01:46:17 AM ==> Cloning from https://github.com/okechukwu26/prisma...
Aug 27 01:46:17 AM ==> Checking out commit 94b103264027bf395f2c71979aad139efcb6df34 in branch main
Aug 27 01:46:21 AM ==> Using Node version 14.17.0 (default)
Aug 27 01:46:21 AM ==> Docs on specifying a Node version: https://render.com/docs/node-version
Aug 27 01:46:21 AM ==> Running build command 'npm install && npm run build'...
Aug 27 01:46:37 AM
Aug 27 01:46:37 AM > prisma@5.2.0 preinstall /opt/render/project/src/node_modules/prisma
Aug 27 01:46:37 AM > node scripts/preinstall-entry.js
Aug 27 01:46:37 AM
Aug 27 01:46:37 AM ┌──────────────────────────────────────────────┐
Aug 27 01:46:37 AM │ Prisma only supports Node.js >= 16.13. │
Aug 27 01:46:37 AM │ Please upgrade your Node.js version. │
Aug 27 01:46:37 AM └──────────────────────────────────────────────┘
Aug 27 01:46:38 AM npm ERR! code ELIFECYCLE
Aug 27 01:46:38 AM npm ERR! errno 1
Aug 27 01:46:38 AM npm ERR! prisma@5.2.0 preinstall: node scripts/preinstall-entry.js
Aug 27 01:46:38 AM npm ERR! Exit status 1
Aug 27 01:46:38 AM npm ERR!
Aug 27 01:46:38 AM npm ERR! Failed at the prisma@5.2.0 preinstall script.
Aug 27 01:46:38 AM npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Aug 27 01:46:38 AM
Aug 27 01:46:38 AM npm ERR! A complete log of this run can be found in:
Aug 27 01:46:38 AM npm ERR! /opt/render/.cache/_logs/2023-08-27T00_46_38_319Z-debug.log
Aug 27 01:46:38 AM ==> Build failed 😞

i got this error while deploying on render and my node version is 20

@Jolg42
Copy link
Member Author

Jolg42 commented Aug 28, 2023

@okechukwu26 I think the code is right here as you can see in your logs Using Node version 14.17.0 so it looks like you need to switch to a newer version on Render.

@okechukwu26
Copy link

Thanks....I have been able to resolve it render was automatically using node 14.3 to build the app so I have to tell it to using the latest version while building

@mmoh-i
Copy link

mmoh-i commented Sep 7, 2023

Thanks....I have been able to resolve it render was automatically using node 14.3 to build the app so I have to tell it to using the latest version while building

kindly help on how you did it

@okechukwu26
Copy link

I created an environment variable on called render node version and input in the value the the node version type 20.5

@christien-kelly
Copy link

To update Render's Node Version, go into your project and create a new environment variable.

NODE_VERSION: *your desired node version.

More details on Render's settings can be found here: https://render.com/docs/node-version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. team/schema Issue for team Schema. topic: cli topic: node version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants