nodejs yarn build 报错下方信息: routines:ssl3_get_record:wrong version number ?

修改 vant源代码 执行 yarn build 命令的时候出现了下方报错
提示 SSL 版本不对
image.png

> vant-cli build

(node:16840) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
i Install Dependencies                                                                                                                                                 15:37:24  

yarn install v1.22.21
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[-----------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0/1631(node:7768) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
error Error: write EPROTO 08240000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:355:

    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Command failed: yarn install --prod=false
    at makeError (D:\DevCode___\xxxx\vant\node_modules\execa\index.js:174:9)
    at D:\DevCode___\xxx\vant\node_modules\execa\index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.installDependencies (D:\DevCode___\xxx\vant\node_modules\@vant\cli\lib\common\manager.js:28:9)
    at async Command.build (D:\DevCode___\A_xxx\vant\node_modules\@vant\cli\lib\commands\build.js:159:9) {
  code: 1,
  stdout: null,
  stderr: null,
  failed: true,
  signal: null,
  cmd: 'yarn install --prod=false',
  timedOut: false,
  killed: false
}

 ERROR  Build failed                                                                                                                                                   15:37:28  

试过修改 Internet SSL TLS 版本
试过清除 yarn 缓存,npm缓存,重新安装一样的报错
试过关闭代理,依旧报错
试过关闭 ssl-strict,也没用
试过淘宝镜像,依旧没用

开发环境
node 21 image.png
win11

阅读 5.1k
1 个回答

看起来是一个很明显的报错:客户端与服务器之间使用了不同版本的SSL/TLS协议

建议先关闭代码,重置host文件,重启电脑

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题