Skip to content

Commit 3e93cc3

Browse files
aduh95danielleadams
authored andcommitted
doc: fix documentation for MODULE_NOT_FOUND and ERR_MODULE_NOT_FOUND
PR-URL: #41645 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent b9d1cb7 commit 3e93cc3

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

doc/api/errors.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,9 +2213,8 @@ transferable object types has been expanded to cover more types than
22132213

22142214
### `ERR_MODULE_NOT_FOUND`
22152215

2216-
> Stability: 1 - Experimental
2217-
2218-
An [ES Module][] could not be resolved.
2216+
A module file could not be resolved by the ECMAScript modules loader while
2217+
attempting an `import` operation or when loading the program entry point.
22192218

22202219
<a id="ERR_MULTIPLE_CALLBACK"></a>
22212220

@@ -2946,8 +2945,8 @@ changes:
29462945
description: Added `requireStack` property.
29472946
-->
29482947

2949-
A module file could not be resolved while attempting a [`require()`][] or
2950-
`import` operation.
2948+
A module file could not be resolved by the CommonJS modules loader while
2949+
attempting a [`require()`][] operation or when loading the program entry point.
29512950

29522951
## Legacy Node.js error codes
29532952

doc/api/modules.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ A required module prefixed with `'./'` is relative to the file calling
427427
Without a leading `'/'`, `'./'`, or `'../'` to indicate a file, the module must
428428
either be a core module or is loaded from a `node_modules` folder.
429429

430-
If the given path does not exist, `require()` will throw an [`Error`][] with its
431-
`code` property set to `'MODULE_NOT_FOUND'`.
430+
If the given path does not exist, `require()` will throw a
431+
[`MODULE_NOT_FOUND`][] error.
432432

433433
## Folders as modules
434434

@@ -1080,7 +1080,7 @@ This section was moved to
10801080
[`"type"`]: packages.md#type
10811081
[`ERR_REQUIRE_ESM`]: errors.md#err_require_esm
10821082
[`ERR_UNSUPPORTED_DIR_IMPORT`]: errors.md#err_unsupported_dir_import
1083-
[`Error`]: errors.md#class-error
1083+
[`MODULE_NOT_FOUND`]: errors.md#module_not_found
10841084
[`__dirname`]: #__dirname
10851085
[`__filename`]: #__filename
10861086
[`import()`]: https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports

0 commit comments

Comments
 (0)