. Advertisement .
..3..
. Advertisement .
..4..
Node.js is one software system created for writing scalable Internet applications, especially web servers. The program is written in JavaScript, using event-driven, asynchronous I/O to minimize overhead and maximize scalability.
Many users, including ourselves, may still run into many errors when running their code. You may face this error, “opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]”
This is a common error made by all programmers. What caused it, and what can be done now to address it? We will work together to find the best solutions.
Why Does The Error “opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]” Occur?
You updated the node to the latest version and you are facing the 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’
The Top Easy Methods to fix this problem
Method 1: Change the build script
In your package, change the build script to something like this. json.
{
"scripts": {
"build": "export NODE_OPTIONS=--openssl-legacy-provider; gatsby build"
}
}
Method 2: Use this code
You need to run this command in your terminal.
node --openssl-legacy-provider ./node_modules/.bin/gatsby build
Your error must now be corrected.
Method 3: Downgrade The Node.js
The last solution is very simple. You need to downgrade your current version.
-
Uninstall Node.js
-
Download and install 16.13.0.
Method 4: Use this option.
Using this way: node_modules\react-scripts\config\webpack.config.js – you have to add this line inside the .js file you find here:
const crypto = require("crypto");
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);
Method 5: Using the package.json file
"scripts": {
"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
Your error must now be corrected.
Conclusion
NodeJS is a platform built on top of the V8 JavaScript Engine – an interpreter that executes JavaScript code that makes building web applications simple and easily extensible.
The solutions presented above are suggestions for those still perplexed by the error “opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]“.
If you still need assistance or have many questions, we have a large community where everyone is usually willing to help. Lastly, we would like to thank all of you who have read this far and wish you a pleasant day of interesting code solutions.
Leave a comment