Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3e93cc3

Browse filesBrowse files
aduh95danielleadams
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 b9d1cb7 commit 3e93cc3
Copy full SHA for 3e93cc3

File tree

Expand file treeCollapse file tree

2 files changed

+7
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-8
lines changed
Open diff view settings
Collapse file

‎doc/api/errors.md‎

Copy file name to clipboardExpand all lines: doc/api/errors.md
+4-5Lines changed: 4 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
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

Collapse file

‎doc/api/modules.md‎

Copy file name to clipboardExpand all lines: doc/api/modules.md
+3-3Lines changed: 3 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.