How To Fix the ERR_OSSL_EVP_UNSUPPORTED Error in Node.js
Fix the ERR_OSSL_EVP_UNSUPPORTED Error
There are two ways to fix the ERR_OSSL_EVP_UNSUPPORTED error:
- Upgrade Node.js by downloading and installing the latest Node.js LTS version.
- Use the
--openssl-legacy-provideroption.
If you cannot or do not want to update your Node.js version, you can fix the problem with a workaround. Specifically, Node.js 17 introduced the --openssl-legacy-provider command line option to revert to the legacy OpenSSL provider.
Use --openssl-legacy-provider in the start npm script as follows:
NODE_OPTIONS=--openssl-legacy-provider npm run start
On Windows, it becomes:
set NODE_OPTIONS=--openssl-legacy-provider && npm run start
In React, update the start and build scripts in package.json with:
"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build"
Check out this article to learn how to fix the error in other technologies and platforms.
Et voilà! Your application should now work like a charm!
linux/git bash
export NODE_OPTIONS=--openssl-legacy-provider && npm run start
Conclusion
ERR_OSSL_EVP_UNSUPPORTED is an annoying error. Anyway, addressing is not difficult and in this article you learned how to do it. In detail, you understood why Node.js 17 raises that error and how to fix it with the --openssl-legacy-provider command line option.
Thanks for reading! I hope you found this article helpful. Feel free to leave any questions, comments, or suggestions.
本文来自博客园,作者:易先讯,转载请注明原文链接:https://www.cnblogs.com/gongxianjin/p/17532396.html

浙公网安备 33010602011771号