buildpacks icon indicating copy to clipboard operation
buildpacks copied to clipboard

getting this error while building react image (digital envelope routines::unsupported)

Open Divyashet66 opened this issue 1 year ago • 3 comments

[builder] Error: error:0308010C:digital envelope routines::unsupported [builder] at new Hash (node:internal/crypto/hash:69:19) [builder] at Object.createHash (node:crypto:138:10) [builder] at BulkUpdateDecorator.hashFactory

Divyashet66 avatar Jun 30 '23 11:06 Divyashet66

@Divyashet66 i dont think we have enough information to identify the issue here. Please help us by providing more information:

Describe the bug Please provide a clear and concise description of what the bug is.

If you have a general question about how to use buildpacks, we encourage you to open a discussion topic instead

Additional context How are you using GCP buildpacks?

  • [ ] pack and the gcr.io/buildpacks/builder
  • [ ] Cloud Functions
  • [ ] Cloud Run
  • [ ] Cloud Build
  • [ ] App Engine Standard
  • [ ] App Engine Flex

Did this used to work? (Yes/No) Was this working before? When did you start noticing these errors?

What language is your project primarily written in? (Python/Java/Node.js/Go/etc.)

Steps To Reproduce Steps to reproduce the behavior:

  1. pack build ...

Expected behavior A clear and concise description of what you expected to happen.

Actual behavior What actually happened?

If applicable, add screenshots / logs / error messages

jama22 avatar Jun 30 '23 16:06 jama22

I used command pack build image_name --builder gcr.io/buildpacks/builder:google-22

while building the image, I got this error

rror: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at BulkUpdateDecorator.hashFactory (/layers/paketo-buildpacks_npm-install/build-modules/node_modules/next/dist/compiled/webpack/bundle5.js:133863:18) at BulkUpdateDecorator.update (/layers/paketo-buildpacks_npm-install/build-modules/node_modules/next/dist/compiled/webpack/bundle5.js:133764:50) at /layers/paketo-buildpacks_npm-install/build-modules/node_modules/next/dist/compiled/webpack/bundle5.js:56911:9 at processTicksAndRejections (node:internal/process/task_queues:82:21) at runNextTicks (node:internal/process/task_queues:64:3) at process.processImmediate (node:internal/timers:447:9) { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }

I think we are getting this error because while installing dependencies we have to do npm i --legacy-peer-deps, but in buildpacks it's not happening

can you please provide a solution for this?

and also how to mention the specific version of nodejs, so that buildpack uses that version of node to build the image,

Thank you so much for your time

Divyashet66 avatar Jul 01 '23 12:07 Divyashet66

I see these in the stack trace /layers/paketo-buildpacks_npm-install and it's possible that you're using a builder other than GCP builder.

smsohan avatar Jul 06 '23 14:07 smsohan