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.

Error:0308010C:digital envelope routines::unsupported

See original GitHub issue

Describe the bug

I installed the latest Node version, currently, it’s 17.2.0. When I try to start the project in development mode with the command npm run start, it throws an error & it’s unable to start the project for development.

Pre-requisites:

Steps to reproduce:

  • run the command npx create-react-app hello-world
  • navigate to the project’s root & run the command: npm run start

Expected results

It was expected to compile in dev mode & launch React’s app in the browser like in the screenshot below: ( which it’s using Node’s version 16.13.1)

expected-result

Actual results

It doesn’t compile & it throws the following error instead:

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 (C:\Users\manue\Desktop\projects\hello-world\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\manue\Desktop\projects\hello-world\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (C:\Users\manue\Desktop\projects\hello-world\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\manue\Desktop\projects\hello-world\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\manue\Desktop\projects\hello-world\node_modules\webpack\lib\NormalModule.js:358:12
    at iterateNormalLoaders (C:\Users\manue\Desktop\projects\hello-world\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (C:\Users\manue\Desktop\projects\hello-world\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
C:\Users\manue\Desktop\projects\hello-world\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at Object.createHash (node:crypto:130:10)
    at module.exports (C:\Users\manue\Desktop\projects\hello-world\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\manue\Desktop\projects\hello-world\node_modules\webpack\lib\NormalModule.js:417:16)
    at C:\Users\manue\Desktop\projects\hello-world\node_modules\webpack\lib\NormalModule.js:452:10
    at C:\Users\manue\Desktop\projects\hello-world\node_modules\webpack\lib\NormalModule.js:323:13
    at C:\Users\manue\Desktop\projects\hello-world\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\Users\manue\Desktop\projects\hello-world\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (C:\Users\manue\Desktop\projects\hello-world\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Users\manue\Desktop\projects\hello-world\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'
}

This is a screenshot of the issue:

actual-result

Workaround

  • uninstall Node’s version 17.2.0
  • install Node’s version 16.13.1
  • run npm run start

The app should compile now.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:36
  • Comments:26

github_iconTop GitHub Comments

9reactions
nicholasrobertsoncommented, Dec 5, 2021

While you wait for a new CRA version, you can run Node version 16 without uninstalling version 17 using nvm

nvm install 16.13.0 nvm run 16.13.0

Have a look at creating a .nvmrc file in your projects root. https://github.com/nvm-sh/nvm#nvmrc

I assume the issue is CRA using webpack-v4 and is resolved upgrading to v5 ( I haven’t actually validated this ) (#14532) #11563 #11562

8reactions
Emekaonycommented, Jan 21, 2022

Just as @TadRodgers and @Manuel-Suarez-Abascal mentioned: downgrading node is probably the best way to go. Did that and everything is working just fine now.

I used:

npm uninstall node to uninstall node npm install node@16.13.1 to install node at that specific version then source ./bash_profile to do some shell magic in order to register my current session with the current installation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error message "error:0308010C:digital envelope routines ...
This fix was a breaking change that corresponded with similar breaking changes in the SSL packages in NPM. When you attempt to use...
Read more >
error:0308010c:digital envelope routines::unsupported [Node ...
What Causes the "0308010c:digital envelope routines::unsupported" Error? You are likely getting this error because of 2 main reasons:.
Read more >
error:0308010C:digital envelope routines::unsupported [Fixed]
The error:0308010C:digital envelope routines::unsupported occurs because Node.js v17 and later use OpenSSL v3.0 which has had breaking changes.
Read more >
How to Fix the Error Error:error:0308010C:digital envelope ...
Error : error:0308010C:digital envelope routines::unsupported ... To fix this error, you can do one of five things:.
Read more >
Error: Error:0308010C:Digital Envelope Routines::Unsupported
The common error:0308010c:digital envelope routines::unsupported bug appears due to outdated Node.JS versions when running development servers.
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