diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index f7c9ab9b7a9326..9fabd0687a1a07 100644 --- a/lib/internal/process/warning.js +++ b/lib/internal/process/warning.js @@ -22,7 +22,9 @@ function writeOut(message) { function onClose(fd) { return () => { if (fs === null) fs = require('fs'); - fs.close(fd, nop); + try { + fs.closeSync(fd); + } catch {} }; }