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