Skip to content

Commit 2bba6cd

Browse files
aduh95ruyadorno
authored andcommitted
doc: fix documentation for MODULE_NOT_FOUND and ERR_MODULE_NOT_FOUND
PR-URL: #41645 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 2cae994 commit 2bba6cd

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

doc/api/errors.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -2225,9 +2225,8 @@ transferable object types has been expanded to cover more types than
22252225

22262226
### `ERR_MODULE_NOT_FOUND`
22272227

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

22322231
<a id="ERR_MULTIPLE_CALLBACK"></a>
22332232

@@ -2958,8 +2957,8 @@ changes:
29582957
description: Added `requireStack` property.
29592958
-->
29602959

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

29642963
## Legacy Node.js error codes
29652964

doc/api/modules.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ A required module prefixed with `'./'` is relative to the file calling
429429
Without a leading `'/'`, `'./'`, or `'../'` to indicate a file, the module must
430430
either be a core module or is loaded from a `node_modules` folder.
431431

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

435435
## Folders as modules
436436

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

0 commit comments

Comments
 (0)