Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I run export NODE_OPTIONS=–openssl-legacy-provider in Webpack script?

I have webpack script that triggers build

"buildProd": "webpack --config webpack.config.js --mode=production --display-error-details"

But it fails with error

 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

I can fix this error manually typing

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

export NODE_OPTIONS=--openssl-legacy-provider

and all works fine

But I need to export NODE_OPTIONS in script for CI.
Is there any way to set NODE_OPTIONS in webpack script?

>Solution :

Use the env tool:

"buildProd": "env NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack.config.js --mode=production --display-error-details"

Alternatively, set the option in your CI provider’s (you’re not telling us what you’re using, so I can’t help more specifically) environment variable settings.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading