Error:0308010C:digital envelope routines::unsupported
See original GitHub issueDescribe 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:
- Node’s version
17.2.0
. - NPM’s version
8.1.41
. - OS: Window 11
- CLI:
Windows PowerShell
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
)
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:
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:
- Created 2 years ago
- Reactions:36
- Comments:26
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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#nvmrcI assume the issue is CRA using webpack-v4 and is resolved upgrading to v5 ( I haven’t actually validated this ) (#14532) #11563 #11562
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 nodenpm install node@16.13.1
to install node at that specific version thensource ./bash_profile
to do some shell magic in order to register my current session with the current installation.