diff --git a/lib/fs.js b/lib/fs.js index e7338997a5f1df..5fb1784605700e 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -813,7 +813,7 @@ function mkdir(path, options, callback) { path = getValidatedPath(path); if (typeof recursive !== 'boolean') - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); const req = new FSReqCallback(); req.oncomplete = callback; @@ -832,7 +832,7 @@ function mkdirSync(path, options) { path = getValidatedPath(path); if (typeof recursive !== 'boolean') - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); const ctx = { path }; binding.mkdir(pathModule.toNamespacedPath(path), diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index cc907c8c9eae68..927bf739e79763 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -333,7 +333,7 @@ async function mkdir(path, options) { } = options || {}; path = getValidatedPath(path); if (typeof recursive !== 'boolean') - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); return binding.mkdir(pathModule.toNamespacedPath(path), parseMode(mode, 'mode', 0o777), recursive, diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index c911587753a091..417f5c7e06b8b5 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -229,7 +229,7 @@ if (common.isMainThread && (common.isLinux || common.isOSX)) { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: 'The "recursive" argument must be of type boolean.' + + message: 'The "options.recursive" property must be of type boolean.' + received } ); @@ -238,7 +238,7 @@ if (common.isMainThread && (common.isLinux || common.isOSX)) { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: 'The "recursive" argument must be of type boolean.' + + message: 'The "options.recursive" property must be of type boolean.' + received } );