diff --git a/lib/fs.js b/lib/fs.js index fedd4dcdb54df2..bf6f93ebb7bf05 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -44,7 +44,6 @@ const { const util = require('util'); const pathModule = require('path'); const { isUint8Array } = require('internal/util/types'); -const { createPromise, promiseResolve } = process.binding('util'); const binding = process.binding('fs'); const fs = exports; @@ -248,6 +247,7 @@ fs.exists = function(path, callback) { Object.defineProperty(fs.exists, internalUtil.promisify.custom, { value: (path) => { + const { createPromise, promiseResolve } = process.binding('util'); const promise = createPromise(); fs.exists(path, (exists) => promiseResolve(promise, exists)); return promise;