tango4567 / solutions

Here I am adding lots of different stuff. This is the collection of problems with their solutions. Most important please share good vibes and correct me if you found anything wrong here. Thanks in advance.
Apache License 2.0
5 stars 0 forks source link

Webpack building failed with ERR_OSSL_EVP_UNSUPPORTED #41

Closed tango4567 closed 3 years ago

tango4567 commented 3 years ago
Starting the development server...

/Users/tarunmahajan/Projects/demo/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/Users/tarunmahajan/Projects/demo/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/tarunmahajan/Projects/demo/node_modules/webpack/lib/NormalModule.js:417:16)
    at /Users/tarunmahajan/Projects/demo/node_modules/webpack/lib/NormalModule.js:452:10
    at /Users/tarunmahajan/Projects/demo/node_modules/webpack/lib/NormalModule.js:323:13
    at /Users/tarunmahajan/Projects/demo/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /Users/tarunmahajan/Projects/demo/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/Users/tarunmahajan/Projects/demo/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /Users/tarunmahajan/Projects/demo/node_modules/react-scripts/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.0.1
error Command failed with exit code 1.

Referene:

  1. Github Nodejs
  2. Github Facebook
  3. Dev Conversation
  4. Stackoverflow
  5. Stackoverflow(Solution)
tango4567 commented 3 years ago

Thank for Solution @akornatskyy :

   `export NODE_OPTIONS=--openssl-legacy-provider`

Solution Worker for following version:

Node: v17.0.1 NPM: 8.1.0

For Detailed Explanation: Stackoverflow Github WebPack

workteam123 commented 2 years ago

Hi @akornatskyy when I try this solution I get --openssl-legacy-provider is not allowed in NODE_OPTIONS. I am running on a mac latest os.

akornatskyy commented 2 years ago

@workteam123 if that option is not allowed, it is possible that you are not using node 17. please double check.