GeezerVison is showing github.com — doc: fix documentation for `MODULE_NOT_FOUND` and `ERR_MODULE_NOT_FOUND` · nodejs/node@3e93cc3
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
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 number | Diff line number | Diff line change |
|---|
@@ -2213,9 +2213,8 @@ transferable object types has been expanded to cover more types than |
2213 | 2213 |
|
2214 | 2214 | ### `ERR_MODULE_NOT_FOUND` |
2215 | 2215 |
|
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. |
2219 | 2218 |
|
2220 | 2219 | <a id="ERR_MULTIPLE_CALLBACK"></a> |
2221 | 2220 |
|
@@ -2946,8 +2945,8 @@ changes: |
2946 | 2945 | description: Added `requireStack` property. |
2947 | 2946 | --> |
2948 | 2947 |
|
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. |
2951 | 2950 |
|
2952 | 2951 | ## Legacy Node.js error codes |
2953 | 2952 |
|
|
Collapse file
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 number | Diff line number | Diff line change |
|---|
@@ -427,8 +427,8 @@ A required module prefixed with `'./'` is relative to the file calling |
427 | 427 | Without a leading `'/'`, `'./'`, or `'../'` to indicate a file, the module must |
428 | 428 | either be a core module or is loaded from a `node_modules` folder. |
429 | 429 |
|
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. |
432 | 432 |
|
433 | 433 | ## Folders as modules |
434 | 434 |
|
@@ -1080,7 +1080,7 @@ This section was moved to |
1080 | 1080 | [`"type"`]: packages.md#type |
1081 | 1081 | [`ERR_REQUIRE_ESM`]: errors.md#err_require_esm |
1082 | 1082 | [`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 |
1084 | 1084 | [`__dirname`]: #__dirname |
1085 | 1085 | [`__filename`]: #__filename |
1086 | 1086 | [`import()`]: https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports |
|