Commit d77ed7854e7 for nodejs

commit d77ed7854e74e7d8b0771e3c67e302b68614fe4a
Author: James M Snell <jasnell@gmail.com>
Date:   Wed Nov 18 04:02:29 2026 -0800

    fs: move DEP0187 to End-of-Life

    Passing an invalid argument type to fs.existsSync() now throws
    ERR_INVALID_ARG_TYPE instead of returning false. Other invalid paths,
    such as strings containing null bytes or non-file: URLs, continue to
    return false.

    This has been a runtime deprecation since v24.0.0.

    Refs: https://github.com/nodejs/node/pull/55753
    Refs: https://github.com/nodejs/node/pull/55892
    Assisted-by: Claude
    Signed-off-by: James M Snell <jasnell@gmail.com>
    PR-URL: https://github.com/nodejs/node/pull/67494
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
    Reviewed-By: LiviaMedeiros <livia@cirno.name>
    Reviewed-By: Richard Lau <richard.lau@ibm.com>

diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md
index 77bd1a743d0..2837a08697f 100644
--- a/doc/api/deprecations.md
+++ b/doc/api/deprecations.md
@@ -4207,6 +4207,9 @@ npx codemod@latest @nodejs/repl-classes-with-new

 <!-- YAML
 changes:
+  - version: REPLACEME
+    pr-url: https://github.com/nodejs/node/pull/67494
+    description: End-of-Life.
   - version: v24.0.0
     pr-url: https://github.com/nodejs/node/pull/55753
     description: Runtime deprecation.
@@ -4218,10 +4221,10 @@ changes:
     description: Documentation-only.
 -->

-Type: Runtime
+Type: End-of-Life

-Passing non-supported argument types is deprecated and, instead of returning `false`,
-will throw an error in a future version.
+Passing non-supported argument types to `fs.existsSync()` throws an
+`ERR_INVALID_ARG_TYPE` error instead of returning `false`.

 ### DEP0188: `process.features.ipv6` and `process.features.uv`

diff --git a/doc/api/fs.md b/doc/api/fs.md
index 929ea302957..186ab76c098 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -6299,6 +6299,10 @@ behavior is similar to `cp dir1/ dir2/`.
 <!-- YAML
 added: v0.1.21
 changes:
+  - version: REPLACEME
+    pr-url: https://github.com/nodejs/node/pull/67494
+    description: Passing an invalid argument type now throws an
+                 `ERR_INVALID_ARG_TYPE` error instead of returning `false`.
   - version: v7.6.0
     pr-url: https://github.com/nodejs/node/pull/10739
     description: The `path` parameter can be a WHATWG `URL` object using
@@ -6308,7 +6312,8 @@ changes:
 * `path` {string|Buffer|URL}
 * Returns: {boolean}

-Returns `true` if the path exists, `false` otherwise.
+Returns `true` if the path exists, `false` otherwise. Throws an
+`ERR_INVALID_ARG_TYPE` error if `path` is not a string, {Buffer}, or {URL}.

 For detailed information, see the documentation of the asynchronous version of
 this API: [`fs.exists()`][].
diff --git a/lib/fs.js b/lib/fs.js
index a5fc9a7571c..c75bfedf73c 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -310,11 +310,11 @@ ObjectDefineProperty(exists, kCustomPromisifiedSymbol, {
   },
 });

-let showExistsDeprecation = true;
 /**
  * Synchronously tests whether or not the given path exists.
  * @param {string | Buffer | URL} path
  * @returns {boolean}
+ * @throws {ERR_INVALID_ARG_TYPE} If `path` is not a string, Buffer, or URL.
  */
 function existsSync(path) {
   const h = vfsState.handlers;
@@ -325,12 +325,7 @@ function existsSync(path) {
   try {
     path = getValidatedPath(path);
   } catch (err) {
-    if (showExistsDeprecation && err?.code === 'ERR_INVALID_ARG_TYPE') {
-      process.emitWarning(
-        'Passing invalid argument types to fs.existsSync is deprecated', 'DeprecationWarning', 'DEP0187',
-      );
-      showExistsDeprecation = false;
-    }
+    if (err?.code === 'ERR_INVALID_ARG_TYPE') throw err;
     return false;
   }

diff --git a/test/parallel/test-fs-exists.js b/test/parallel/test-fs-exists.js
index 3be2197660c..009ca87fda8 100644
--- a/test/parallel/test-fs-exists.js
+++ b/test/parallel/test-fs-exists.js
@@ -50,9 +50,11 @@ fs.exists({}, common.mustCall(function(y) {
 assert(fs.existsSync(f));
 assert(!fs.existsSync(`${f}-NO`));

-// fs.existsSync() never throws
-const msg = 'Passing invalid argument types to fs.existsSync is deprecated';
-common.expectWarning('DeprecationWarning', msg, 'DEP0187');
-assert(!fs.existsSync());
-assert(!fs.existsSync({}));
+// fs.existsSync() throws on invalid argument types
+assert.throws(() => fs.existsSync(), { code: 'ERR_INVALID_ARG_TYPE' });
+assert.throws(() => fs.existsSync({}), { code: 'ERR_INVALID_ARG_TYPE' });
+assert.throws(() => fs.existsSync(123), { code: 'ERR_INVALID_ARG_TYPE' });
+
+// Other invalid paths still return false instead of throwing
 assert(!fs.existsSync(new URL('https://foo')));
+assert(!fs.existsSync('foo\u0000bar'));