Skip to content
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

支持 node18 #173

Open
liaoyu opened this issue May 13, 2023 · 0 comments · May be fixed by #177
Open

支持 node18 #173

liaoyu opened this issue May 13, 2023 · 0 comments · May be fixed by #177

Comments

@liaoyu
Copy link
Collaborator

liaoyu commented May 13, 2023

当前 node18 已经设置为 LTS,而 node12 去年 4 月已停止维护,详情见 https://github.com/nodejs/Release

对 builder 的影响

由 v16 升级至 v18 比如大的 breaking change 是 OpenSSL 3.0 里 md4 哈希算法默认不可用,这个算法在 webpack 生态又用到较多,这个问题会提示错误:Error: error:0308010C:digital envelope routines::unsupported

https://nodejs.org/en/blog/release/v17.0.0
https://nodejs.org/en/blog/release/v18.0.0

相关讨论:
webpack/webpack#14532
https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

升级方案

  1. https://github.com/qiniu/builder/releases/tag/v2.7.0 以后的版本可通过设置 node 环境变量使用
NODE_OPTIONS=--openssl-legacy-provider fec-builder -p 8080

# 或者设置全局变量
export NODE_OPTIONS=--openssl-legacy-provider
fec-builder -p 8080
  1. 需升级各依赖库
  • 升级至最新的 webpack,最新 webpack 又依赖 typescript 5,直接或间接依赖升级之后又要求大于 node12 版本,所以计划在 3.0 版本处理
@liaoyu liaoyu linked a pull request Jun 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant