-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 [BUG] digital envelope routines::unsupported #10824
Comments
Linux, macOS, Git bash, 输入: winndows系统输入: |
感谢您提供的错误信息。这个问题似乎是由于标准Node.js加密库与您的环境中的某个openssl版本不兼容引起的。您可以尝试通过设置 对于Linux、macOS和Git Bash,请在命令行中输入以下命令:
对于Windows系统,请在命令行中输入以下命令:
设置完成后,尝试重新运行您的项目看是否能够解决问题。 如果问题依然存在,您可以尝试以下解决方案:
如果以上方法都无法解决问题,您可以尝试使用其他加密库,如 const SHA256 = require('crypto-js/sha256');
const data = 'Hello, World!';
const hash = SHA256(data).toString();
console.log(hash); 请确保在使用 除了以上解决方案,您还可以检查您的代码是否与其他模块或库存在冲突,并确保正确导入和使用React相关的依赖。 希望这些信息能够帮助您解决问题。如果问题仍然存在,请提供更多错误信息或代码示例,以便我们能够提供更准确的解决方案。 |
这个错误通常是由于缺少适当的 OpenSSL 版本导致的。你可以尝试以下解决方案来解决这个问题:
如果以上解决方案都无法解决问题,可能需要进一步检查你的代码和环境配置。如果你可以提供更多关于你的项目配置、代码片段或其他相关的错误信息,我可以帮助你给出更具体的解决方案。 |
@chenshuai2144 我在运行打包命令时出现了该问题。 首先我在运行 - "start": "cross-env UMI_ENV=dev umi dev",
+ "start": "cross-env NODE_OPTIONS=--openssl-legacy-provider UMI_ENV=dev umi dev", 但该问题在运行
系统信息如下
尝试过 #10824 (comment) #10824 (comment) 的办法都无法解决。更换使用 |
build 的时候也加下环境变量 |
@chenshuai2144 谢谢提醒。按下述方法可以解决 - "build": "umi build",
+ "build": "cross-env NODE_OPTIONS=--openssl-legacy-provider umi build", |
nodejs 版本v16.20.0, 18.0也试过了,也不行
node:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:130:10)
at BulkUpdateDecorator.hashFactory (/home/mason/project/ecommerce/dashboard/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:184154:18)
at BulkUpdateDecorator.digest (/home/mason/project/ecommerce/dashboard/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:184089:21)
at /home/mason/project/ecommerce/dashboard/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:107234:49
at done (/home/mason/project/ecommerce/dashboard/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:38350:13)
at /home/mason/project/ecommerce/dashboard/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:180888:5
at Hook.eval [as callAsync] (eval at create (/home/mason/project/ecommerce/dashboard/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:50186:10), :6:1)
at AsyncQueue._handleResult (/home/mason/project/ecommerce/dashboard/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:180858:21)
at /home/mason/project/ecommerce/dashboard/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:180841:11
at /home/mason/project/ecommerce/dashboard/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:107076:4
at callback (/home/mason/project/ecommerce/dashboard/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:34510:20)
at FSReqCallback.oncomplete (node:fs:203:5) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code
The text was updated successfully, but these errors were encountered: