diff --git a/lib/readline-sync.js b/lib/readline-sync.js index f34579d..97f15f8 100644 --- a/lib/readline-sync.js +++ b/lib/readline-sync.js @@ -269,6 +269,9 @@ function _readlineSync(options) { if (!fsB) { fsB = process.binding('fs'); // For raw device path constants = process.binding('constants'); + // for v6.3.0+ + constants = constants && constants.fs && typeof constants.fs.O_RDWR === 'number' + ? constants.fs : constants; } return fsB; }