[v11.x-backport] Backport 24861 to v11.x
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Re: https://github.com/nodejs/node/pull/24861#event-2046977683