当你在使用 Node.js 运行程序时,如果出现了 "node: --openssl-legacy-provider is not allowed in NODE_OPTIONS" 的错误提示,这是因 为在 NODE_OPTIONS 环境变量中使用了 --openssl-legacy-provider 选项,而该选项已经被弃用。为了解决这个问题,你可以采取以下几 种方式:

1. 删除 NODE_OPTIONS 环境变量中的 --openssl-legacy-provider 选项。你可以在命令行中输入 "SET NODE_OPTIONS=" 命令来清 空 NODE_OPTIONS 环境变量。

2. 如果你需要继续使用 NODE_OPTIONS 环境变量中的其它选项,可以考虑去掉 --openssl-legacy-provider 选项。在命令行中运行 node,然后在控制台中输入 "process.env.NODE_OPTIONS = process.env.NODE_OPTIONS.replace('--openssl-legacy-provider', '')",然后回车,即可去掉该选项。

3. 在命令行中直接运行 "node --openssl-legacy-provider=false" 命令,该命令会将 NODE_OPTIONS 环境变量清空,从而避免了 -- openssl-legacy-provider 选项的影响。

相关问题

node: --openssl-legacy-provider is not allowed in NODE_OPTIONS解决 这个错误是因为在NODE_OPTIONS中使用了--openssl-legacy-provider选项,但是该选项已经被弃用了。解决方法有两种:

1.升级你的应用代码,支持新版本的node.js。

2.删除NODE_OPTIONS中的--openssl-legacy-provider选项。可以在命令行中输入以下代码来删除该选项:

SET NODE_OPTIONS=%NODE_OPTIONS:--openssl-legacy-provider=%

openssl
传输层安全性/安全套接层及其加密库

这样就可以正常运行你的应用程序了。

解决node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

这个问题是因为在 Node.js 版本 16.0.0 中,不再支持使用 --openssl-legacy-provider 参数来使用 OpenSSL 库,而该参数在 NODE_OPTIONS 环境变量中被设置。要解决这个问题,有两种方法:

1. 升级到 Node.js 版本 16.1.0 或更高版本。在这些版本中,--openssl-legacy-provider 参数已经被废弃,不再需要使用。

2. 如果你无法升级 Node.js 版本,可以在 NODE_OPTIONS 环境变量中将 --openssl-legacy-provider 参数移除。你可以编辑你的环境 变量,或者在命令行中使用 export 命令来设置环境变量。例如,在 Linux 或 macOS 系统中,可以使用以下命令:

export NODE_OPTIONS="${NODE_OPTIONS/--openssl-legacy-provider/}"

这个命令会将 NODE_OPTIONS 环境变量中的 --openssl-legacy-provider 参数移除。在 Windows 系统中,可以使用以下命令:

set NODE_OPTIONS=%NODE_OPTIONS:--openssl-legacy-provider=%

这个命令会将 NODE_OPTIONS 环境变量中的 --openssl-legacy-provider 参数移除。

GitHub 加速计划 / ope / openssl
26
1
下载
传输层安全性/安全套接层及其加密库
最近提交(Master分支:6 个月前 )
0a16bb7e One part of the OpenSSL guide suggests we only support clients for QUIC which is no longer true. Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from https://github.com/openssl/openssl/pull/27265) 2 天前
69acfa35 Recently ci on master has been failing: https://github.com/openssl/openssl/actions/runs/14234051502/job/39919663876 Its occuring because the s390 gcc compiler is complaining about various functions attempting to write past the end of an array. However, I can find no case in which we actually do so in this case. The problem resolves when we either: 1) Disable the stringop-overflow warning or 2) disable all loop unrolling optimizations with fno-loop-nest-optimize Given that asan doesn't report any out of bounds errors on s390 when built with case (1), and case (2) can be a significant performance hit, coupled with the fact that gcc on any other platform avoids the same issue (s390 is stuck on gcc 12, instead of gcc 16 where the other platforms are), I think the right thing to do is just disable the warning here Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/27253) 3 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐