Files
node/lib/internal
Aditi 5dafb48f1a module: fix require.resolve() crash on non-string paths
Previously, `require.resolve()` could crash when:
- The first parameter was a relative path and
- The `paths` array contained non-string entries

This commit fixes the issue by adding a check in
`Module._findPath` to ensure all elements in `paths`
are strings, and adding a validation in `stat` before
calling `InternalModuleStat` to guard against
non-string filenames.

PR-URL: https://github.com/nodejs/node/pull/56942
Fixes: https://github.com/nodejs/node/issues/47698
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-02-11 15:24:02 +00:00
..
2024-09-24 19:48:15 +00:00
2024-09-25 14:35:18 +00:00
…
2025-02-11 13:32:26 +00:00
2024-09-09 17:24:10 +02:00
…
2024-10-09 06:42:16 +00:00
…
2024-10-09 06:42:16 +00:00
2025-02-08 12:43:53 +00:00
…
…
…
2024-09-24 19:48:15 +00:00
…
2024-12-04 09:29:30 -08:00
…
2024-09-24 22:26:59 +02:00
2025-02-01 02:13:57 +00:00
2024-08-27 14:58:36 +00:00
…

Internal Modules

The modules located in lib/internal directory are exclusively meant for internal usage within the Node.js core. They are not intended to be accessed via user modules require(). These modules may change at any point in time. Relying on these internal modules outside the core is not supported and can lead to unpredictable behavior.

In certain scenarios, accessing these internal modules for debugging or experimental purposes might be necessary. Node.js provides the --expose-internals flag to expose these modules to userland code. This flag only exists to assist Node.js maintainers with debugging internals. It is not meant for use outside the project.