Today We are Going To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] in nodejs. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.
Contents
- 1 How to Fix opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error?
- 1.1 Solution 1 : Run this command
- 1.2 Solution 2 : Change the build script
- 2 Conclusion
- 2.1 Also Read This Solutions
- How to Fix opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error?
To Fix opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error just Run this command. To solve your error just run this command in your terminal and your error will be solved.
export NODE_OPTIONS=--openssl-legacy-provider
- opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]
To Fix opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error just Change the build script. Here to solve this error just change the build script in your package.json just like below. This will solve your error. Hope this will help you!
{ "scripts": { "build": "export NODE_OPTIONS=--openssl-legacy-provider; gatsby build" } }
Solution 1 : Run this command
To solve your error just run this command in your terminal and your error will be solved.
export NODE_OPTIONS=--openssl-legacy-provider
Solution 2 : Change the build script
Here to solve this error just change the build script in your package.json just like below. This will solve your error. Hope this will help you!
{
"scripts": {
"build": "export NODE_OPTIONS=--openssl-legacy-provider; gatsby build"
}
}
Conclusion
So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.
Also Read This Solutions
- certificate verify failed: unable to get local issuer certificate
- VSCode: The Python path in your debug configuration is invalid
- Module not found: Error: Can’t resolve ‘fs’ in
- Building wheel for numpy (pyproject.toml)
- UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte
Hello Guys, How are you all? Hope You all Are Fine. Today I just updated node to latest version and I am facing following error opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] in nodejs. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
Contents
- How this Error Occurs ?
- How To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error ?
- Solution 1: Just use this command
- Solution 2: change the
build
script - Summary
How this Error Occurs ?
I just updated node to latest version and I am facing following error.
Error: digital envelope routines::unsupported
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’
- How To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error ?
To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error If you hit an
ERR_OSSL_EVP_UNSUPPORTED
error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option,--openssl-legacy-provider
, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions. Just run this command in Your terminal. node –openssl-legacy-provider ./node_modules/.bin/gatsby build Now your error must be solved. - opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]
To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error If you hit an
ERR_OSSL_EVP_UNSUPPORTED
error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option,--openssl-legacy-provider
, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions. Just run this command in Your terminal. node –openssl-legacy-provider ./node_modules/.bin/gatsby build Now your error must be solved.
Solution 1: Just use this command
Here is official Message : If you hit an ERR_OSSL_EVP_UNSUPPORTED
error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option, --openssl-legacy-provider
, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions.
Just run this command in Your terminal.
node --openssl-legacy-provider ./node_modules/.bin/gatsby build
Now your error must be solved.
Solution 2: change the build
script
You should change the build script something like this in your package.json.
{
"scripts": {
"build": "export NODE_OPTIONS=--openssl-legacy-provider; gatsby build"
}
}
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read
- fatal: unable to access ‘https://gopkg.in/yaml.v3/’: server certificate verification failed
- Message: Trying to access array offset on value of type null
- Error: This command is not available when running the Angular CLI outside a workspace
- node: /lib64/libm.so.6: version `GLIBC_2.27′ not found (required by node)
- Solving environment: failed with initial frozen solve. Retrying with flexible solve
- pip is configured with locations that require TLS/SSL however the ssl module in Python is not available
- Can’t find Python executable “python”, you can set the PYTHON env variable
1. Purpose
In this post, I would demo how to solve the following issue when using npm start
to start a reactjs application:
Starting the development server...
/Users/bswen/js-projects/my-app/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/bswen/js-projects/my-app/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/Users/bswen/js-projects/my-app/node_modules/webpack/lib/NormalModule.js:417:16)
at /Users/bswen/js-projects/my-app/node_modules/webpack/lib/NormalModule.js:452:10
at /Users/bswen/js-projects/my-app/node_modules/webpack/lib/NormalModule.js:323:13
at /Users/bswen/js-projects/my-app/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /Users/bswen/js-projects/my-app/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at context.callback (/Users/bswen/js-projects/my-app/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at /Users/bswen/js-projects/my-app/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.1.0
➜ my-app git:(master) ✗
The core error message is:
Error: error:0308010C:digital envelope routines::unsupported
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
How to solve this issue?
2. Environment
- Node.js version: v17.1.0
- npm version: npm: ‘8.1.2’
3. The solution
3.1 Solution #1
Just execute this from command line:
export NODE_OPTIONS=--openssl-legacy-provider
Then run:
What is openssl-legacy-provider?
The OpenSSL legacy provider supplies OpenSSL implementations of algorithms that have been deemed legacy. Such algorithms have commonly fallen out of use, have been deemed insecure by the cryptography community, or something similar. We can consider this the retirement home of cryptographic algorithms.
For node.js version v17, it has some claims about this issue:
OpenSSL 3.0
Node.js now includes OpenSSL 3.0, specifically quictls/openssl which provides QUIC support. With OpenSSL 3.0 FIPS support is again available using the new FIPS module. For details about how to build Node.js with FIPS support please see BUILDING.md.
While OpenSSL 3.0 APIs should be mostly compatible with those provided by OpenSSL 1.1.1, we do anticipate some ecosystem impact due to tightened restrictions on the allowed algorithms and key sizes.
If you hit an
ERR_OSSL_EVP_UNSUPPORTED
error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A command-line option,--openssl-legacy-provider
, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions.For details about all the features in OpenSSL 3.0 please see the OpenSSL 3.0 release blog.
3.2 Solution #2
Downgrade your node.js to v16 like this:
$ npm install -g n
$ n 16.13.0
3.3 The reason of the issue
The reason is clear, we are using a old version of SSL algorithm that is no longer supported in new openssl version.
4. Summary
In this post, I demonstrated how to solve the ERR_OSSL_EVP_UNSUPPORTED
error when using npm start
to start a react.js application, the key problem is the incompatibility between node.js v17 and openssl v3, so the solution is either to workaround the issue by providing a special environment variable or to downgrade your node.js. That’s it, thanks for your reading.
Содержание
- opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] #15900
- Comments
- [Solved] opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]
- How this Error Occurs ?
- How To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error ?
- Solution 1: Just use this command
- Solution 2: change the build script
- Summary
- expo start —web fails «error:03000086:digital envelope routines::initialization error» #4037
- Comments
- Summary
- Environment
- Please specify your device/emulator/simulator platform, model and version
- Error output
- Reproducible demo or steps to reproduce from a blank project
- Opensslerrorstack error 03000086 digital envelope routines initialization error
- error:0308010C:digital envelope routines::unsupported [Fixed] #
- Update your react-scripts version if you use create-react-app #
- Try updating your NPM packages #
- Downgrade to Node.js version 16 #
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] #15900
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:133:10)
at module.exports (E:full stack web devReact Projectmy-appnode_moduleswebpacklibutilcreateHash.js:90:53)
at NormalModule._initBuildHash (E:full stack web devReact Projectmy-appnode_moduleswebpacklibNormalModule.js:401:16)
at E:full stack web devReact Projectmy-appnode_moduleswebpacklibNormalModule.js:433:10
at E:full stack web devReact Projectmy-appnode_moduleswebpacklibNormalModule.js:308:13
at E:full stack web devReact Projectmy-appnode_modulesloader-runnerlibLoaderRunner.js:367:11
at E:full stack web devReact Projectmy-appnode_modulesloader-runnerlibLoaderRunner.js:233:18
at context.callback (E:full stack web devReact Projectmy-appnode_modulesloader-runnerlibLoaderRunner.js:111:13)
at E:full stack web devReact Projectmy-appnode_modulesbabel-loaderlibindex.js:51:103 <
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’
>
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
npm start should display the page which is being failed
Other relevant information:
webpack version: webpack@4.28.3
Node.js version: v18.2.0
Operating System: windows 11 64 bit
Additional tools: React.js
The text was updated successfully, but these errors were encountered:
**
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_moduleswebpacklibutilcreateHash.js:135:53)
at NormalModule._initBuildHash (C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_moduleswebpacklibNormalModule.js:417:16)
at handleParseError (C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_moduleswebpacklibNormalModule.js:471:10)
at C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_moduleswebpacklibNormalModule.js:503:5
at C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_moduleswebpacklibNormalModule.js:358:12
at C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_modulesloader-runnerlibLoaderRunner.js:373:3
at iterateNormalLoaders (C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_modulesloader-runnerlibLoaderRunner.js:214:10)
at iterateNormalLoaders (C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_modulesloader-runnerlibLoaderRunner.js:221:10)
C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_modulesreact-scriptsscriptsstart.js:19
throw err;
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_moduleswebpacklibutilcreateHash.js:135:53)
at NormalModule._initBuildHash (C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_moduleswebpacklibNormalModule.js:417:16)
at C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_moduleswebpacklibNormalModule.js:452:10
at C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_moduleswebpacklibNormalModule.js:323:13
at C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_modulesloader-runnerlibLoaderRunner.js:367:11
at C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_modulesloader-runnerlibLoaderRunner.js:233:18
at context.callback (C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_modulesloader-runnerlibLoaderRunner.js:111:13)
at C:UsersadminDownloadsnewexamination-management-systemclientesm-clientnode_modulesbabel-loaderlibindex.js:59:103 <
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’
>
**
As a little workaround, you can try running node in DEBUG by setting your environment variable
export DEBUG=true (in bash). then env to confirm it set
setx DEBUG true (for Windows Powershell?) then $env to confirm it set
For some reason the DebugHash() alternative worked fine.
Please i face the same problem as this one, please can someone help me with how i am going to solve it
Источник
[Solved] opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]
Hello Guys, How are you all? Hope You all Are Fine. Today I just updated node to latest version and I am facing following error opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] in nodejs. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How this Error Occurs ?
I just updated node to latest version and I am facing following error.
Error: digital envelope routines::unsupported
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’
How To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error ?
- How To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error ?
To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option, —openssl-legacy-provider , has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions. Just run this command in Your terminal. node –openssl-legacy-provider ./node_modules/.bin/gatsby build Now your error must be solved.
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]
To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option, —openssl-legacy-provider , has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions. Just run this command in Your terminal. node –openssl-legacy-provider ./node_modules/.bin/gatsby build Now your error must be solved.
Solution 1: Just use this command
Here is official Message : If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option, —openssl-legacy-provider , has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions.
Just run this command in Your terminal.
Now your error must be solved.
Solution 2: change the build script
You should change the build script something like this in your package.json.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Источник
expo start —web fails «error:03000086:digital envelope routines::initialization error» #4037
Summary
expo start —web
fails «error:03000086:digital envelope routines::initialization error»
Environment
Please specify your device/emulator/simulator platform, model and version
Error output
Reproducible demo or steps to reproduce from a blank project
uninstalled node17, installed latest node16.x, seems to work fine
The text was updated successfully, but these errors were encountered:
Looks like this is a new Node 17 issue.
Good find!
Where would export NODE_OPTIONS=—openssl-legacy-provider go @EvanBacon ?
@tomByrer Did you ever figure this out?
Posting back incase this helps someone / saves them 20 minutes of researching:
«start»: «set NODE_OPTIONS=—openssl-legacy-provider && expo start «, in package.json worked to stop that error for me. This is on Windows 10.
Complementing @robinmalik latest post, for *nix/ *nux envs the script command in package.json should be:
i have the same problem, i try to fix but i can’t, help please.
Starting the development server.
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:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_moduleswebpacklibutilcreateHash.js:135:53)
at NormalModule._initBuildHash (C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_moduleswebpacklibNormalModule.js:417:16)
at handleParseError (C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_moduleswebpacklibNormalModule.js:471:10)
at C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_moduleswebpacklibNormalModule.js:503:5
at C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_moduleswebpacklibNormalModule.js:358:12
at C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_modulesloader-runnerlibLoaderRunner.js:373:3
at iterateNormalLoaders (C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_modulesloader-runnerlibLoaderRunner.js:214:10)
at iterateNormalLoaders (C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_modulesloader-runnerlibLoaderRunner.js:221:10)
C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_modulesreact-scriptsscriptsstart.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 (C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_moduleswebpacklibutilcreateHash.js:135:53)
at NormalModule._initBuildHash (C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_moduleswebpacklibNormalModule.js:417:16)
at C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_moduleswebpacklibNormalModule.js:452:10
at C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_moduleswebpacklibNormalModule.js:323:13
at C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_modulesloader-runnerlibLoaderRunner.js:367:11
at C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_modulesloader-runnerlibLoaderRunner.js:233:18
at context.callback (C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_modulesloader-runnerlibLoaderRunner.js:111:13)
at C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplatenode_modulesreact-scriptsnode_modulesbabel-loaderlibindex.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.2.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS C:UsersDiablo_IIDesktopweb 3.0ethereum-boilerplate>
Again, like has been said before, Node 17 is not supported currently, the CLI will warn you multiple times about that when you try to run any of the commands. The underlying issue has already been linked above. There is a workaround mentioned in that thread and above here as well, but YMMV. Your best option is to stick to a version of Node that Expo supports (12-16).
The above mentioned workaround doesn’t seem to have any effect.
<
«scripts»: <
«start»: «export NODE_OPTIONS=—openssl-legacy-provider && expo start»
>
>
perfect work on M1 Mac, when I using Node 17 and expo
For any future readers «export NODE_OPTIONS=—openssl-legacy-provider && expo start» solved this for me as well. I’m on a WSL2, node 18.1.0
Thanks leonzhang51,
it worked for me, this is my setup on package.json. I’m using Lubuntu as OS, Node v 17.9
«scripts»: <
«start»: «ng serve, export NODE_OPTIONS=—openssl-legacy-provider && expo start»,
«build»: «ng build»,
«test»: «ng test»,
«lint»: «ng lint»,
«e2e»: «ng e2e»
>,
Add this to package.json
«scripts»: <
«start»: «react-scripts —openssl-legacy-provider start»,
«build»: «react-scripts —openssl-legacy-provider build»,
>
Источник
Opensslerrorstack error 03000086 digital envelope routines initialization error
Reading time В· 4 min
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. To resolve the error, set the NODE_OPTIONS environment variable to —openssl-legacy-provider when running your development server.
Open your terminal and run the specific command for your shell type.
The —openssl-legacy-provider option is needed when using the latest version of Node.js, because Node.js 17 and later uses OpenSSL 3.0 which has had some breaking changes.
If the error persists, try using the —openssl-legacy-provider flag when issuing the command in your package.json file.
Here is an example of how you would do that with create-react-app .
Simply add —openssl-legacy-provider at the end of your command.
If you get an error that «node: —openssl-legacy-provider is not allowed in NODE_OPTIONS», unset the NODE_OPTIONS environment variable and rerun the command.
Try to rerun your script after deleting the environment variable.
If that doesn’t help, try to set the NODE_OPTIONS environment variable right before issuing the command.
Install the cross-env package to resolve the error.
And prefix the environment variable and the command with cross-env .
We simply prefixed the command in the package.json script with NODE_OPTIONS=—openssl-legacy-provider , e.g. NODE_OPTIONS=—openssl-legacy-provider YOUR_COMMAND_HERE .
For example, for an Angular app, your package.json script would look similar to the following.
If you use create-react-app , update your react-scripts version because the package introduced some fixes regarding its Webpack config in version 5.0.0 .
Update your react-scripts version if you use create-react-app #
The «error:0308010C:digital envelope routines::unsupported» also occurs if you have an outdated version of react-scripts in your create-react-app project.
Open your terminal and run the following command to update your version of react-scripts .
If the error persists, try to delete your node_modules and package-lock.json (not package.json ) files, rerun the npm install and restart your dev server.
Try to restart your development server after updating your react-scripts version.
You can install a specific version using the following command.
The version of Webpack in react-scripts version 5.0.0+ has been updated which should resolve the issue in your create-react-app project.
Try updating your NPM packages #
The following command installs major updates to top-level dependencies, which might introduce breaking changes to your project if you rely on older package versions.
Updating the versions of your packages might solve the error because the maintainers might have introduced security patches in more recent versions.
If the error persists, try running the npm update command.
If you still get an error, try to delete your node_modules and package-lock.json , rerun the npm install command and restart your development server.
Try to restart your development server after running the npm audit fix —force command.
If none of the suggestions helped, you can downgrade your Node.js version to 16.13.0 to resolve the error.
Downgrade to Node.js version 16 #
You can issue the following command to downgrade your Node.js version to 16.13.0 if you use NVM.
The error often occurs when installing Node.js version 17+. Rolling back to version 16.X.X solves it.
The —openssl-legacy-provider option is needed when using the latest version of Node.js, because Node.js 17 and later uses OpenSSL 3.0 which has had some breaking changes.
If you still get the error after downgrading to Node version 16, try to delete your node_modules and package-lock.json , rerun the npm install command and restart your development server.
Restart your development server after issuing the npm install command.
Источник
Digital envelope routines are cryptographic functions that encrypt and securely decrypt data.
The envelope routines use a combination of symmetric and asymmetric encryption methods to ensure the transmitted data’s confidentiality, integrity, and authenticity.
The error:03000086:digital envelope routines::initialization occurs when there is a problem with the initialization of the digital envelope routines used in your Node.js application.
How to fix error:03000086:digital envelope routines::initialization
Uninstall Node.js version 17+ and reinstall Node.js version 16+, which will fix error:03000086:digital envelope routines::initialization.
Follow the below steps to solve the error.
Step 1: Install Node.js
There are many ways you can use to install Node.js in your application.
- Use the NVM to install Node.js.
- Install the current LTS Node.js version from their official site.
Step 2: Open a terminal and hit the following commands
For Linux and MacOS users, hit the following command.
export NODE_OPTIONS=--openssl-legacy-provider
For Windows users, hit the following command.
set NODE_OPTIONS=--openssl-legacy-provider
For Windows PowerShell users,
$env:NODE_OPTIONS = "--openssl-legacy-provider"
This will resolve the error in your Node.js application.
Using React.js
If you are using React application, add these scripts in the package.json file to resolve the error.
"scripts": {
"start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
"build": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
}
Using Vue.js
If using a Vue.js application, add these scripts to the package.json file.
"scripts": {
"serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"lint": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"
},
In this code, –openssl-legacy-provider means you are most certainly running with known insecure SSL, so this might mitigate the symptom, but it presumably doesn’t fix the underlying problem.
If you are still facing the error, then might be a problem with encryption.
Potential cause of the error
- Using an incorrect encryption algorithm.
- Using the unsupported padding method.
- Using the incorrect or missing cryptographic key.
- Using unsupported key size.
That’s it for this article.