{"record":{"id":"099f68a0b8cb5f67","repo":"denoland/deno","slug":"err-invalid-arg-value-099f68","errorCode":"ERR_INVALID_ARG_VALUE","errorMessage":"The property 'options.recursive' is no longer supported. Received ${inspect(value)}","messagePattern":"The property 'options\\.recursive' is no longer supported\\. Received (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"ext/node/polyfills/fs.ts","lineNumber":1876,"sourceCode":"function rmdir(\n  path: string | Buffer | URL,\n  options: rmdirOptions,\n  callback: rmdirCallback,\n): void;\nfunction rmdir(\n  path: string | Buffer | URL,\n  options: rmdirOptions | rmdirCallback | undefined,\n  callback?: rmdirCallback,\n) {\n  if (typeof options === \"function\") {\n    callback = options;\n    options = undefined;\n  }\n\n  if (options?.recursive !== undefined) {\n    // The `recursive` option was deprecated and removed in Node. Throw with a\n    // clear message rather than silently doing the wrong thing.\n    throw new ERR_INVALID_ARG_VALUE(\n      \"options.recursive\",\n      options.recursive,\n      \"is no longer supported\",\n    );\n  }\n\n  validateFunction(callback, \"cb\");\n  path = getValidatedPathToString(path);\n\n  validateRmdirOptions(options);\n  PromisePrototypeThen(\n    op_node_rmdir(path),\n    (_) => callback(),\n    (err: Error) =>\n      callback(\n        denoErrorToNodeError(err, { syscall: \"rmdir\", path }),\n      ),\n  );","sourceCodeStart":1858,"sourceCodeEnd":1894,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/ext/node/polyfills/fs.ts#L1858-L1894","documentation":"Node removed the recursive option from fs.rmdir (deprecated since v14.14, hard error in v16+); Deno's polyfill follows suit and throws ERR_INVALID_ARG_VALUE('options.recursive', ..., 'is no longer supported') instead of silently doing a non-recursive rmdir. The check fires before any filesystem operation.","triggerScenarios":"fs.rmdir(dir, { recursive: true }, cb) — including falsy-but-present values like recursive: false? No: only when options.recursive !== undefined, so { recursive: undefined } passes but any defined value throws.","commonSituations":"Old tutorials and pre-Node-14 code using rmdir for recursive deletion; dependencies that have not been updated for modern Node semantics; CI upgrading from Node 12-era behavior.","solutions":["Replace with fs.rm(dir, { recursive: true }, cb) — rm supports recursive removal","Set recursive: undefined or omit the key entirely if you truly want a non-recursive rmdir","Audit dependencies for rmdir recursive usage after upgrading Node/Deno"],"exampleFix":"// before\nfs.rmdir(dir, { recursive: true }, cb); // ERR_INVALID_ARG_VALUE\n\n// after\nfs.rm(dir, { recursive: true }, cb);","handlingStrategy":"validation","validationCode":"const removeDir = (dir: string, recursive: boolean, cb: (e?: Error | null) => void) =>\n  recursive ? fs.rm(dir, { recursive: true }, cb) : fs.rmdir(dir, cb);","typeGuard":"const hasRecursive = (o: unknown): o is { recursive: boolean } =>\n  typeof o === 'object' && o !== null && 'recursive' in o && (o as any).recursive !== undefined;","tryCatchPattern":null,"preventionTips":["Treat rmdir as non-recursive by definition; route all recursive deletion through fs.rm","Remember recursive: false also throws — only undefined or an absent key passes","Codemod/grep for 'rmdir' + 'recursive' when upgrading Node-14-era code"],"tags":["node-compat","filesystem","rmdir","breaking-change"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}