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 2bba6cd

Browse filesBrowse 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
Copy full SHA for 2bba6cd

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
@@ -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

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
@@ -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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.