mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
doc: fix documentation for MODULE_NOT_FOUND and ERR_MODULE_NOT_FOUND
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
b9d1cb7f8a
commit
3e93cc392e
2 files changed
+7
-8
No files matched your search
+4
-5
@@ -2213,9 +2213,8 @@ transferable object types has been expanded to cover more types than
|
||||
|
||||
### `ERR_MODULE_NOT_FOUND`
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
An [ES Module][] could not be resolved.
|
||||
A module file could not be resolved by the ECMAScript modules loader while
|
||||
attempting an `import` operation or when loading the program entry point.
|
||||
|
||||
<a id="ERR_MULTIPLE_CALLBACK"></a>
|
||||
|
||||
@@ -2946,8 +2945,8 @@ changes:
|
||||
description: Added `requireStack` property.
|
||||
-->
|
||||
|
||||
A module file could not be resolved while attempting a [`require()`][] or
|
||||
`import` operation.
|
||||
A module file could not be resolved by the CommonJS modules loader while
|
||||
attempting a [`require()`][] operation or when loading the program entry point.
|
||||
|
||||
## Legacy Node.js error codes
|
||||
|
||||
|
||||
+3
-3
@@ -427,8 +427,8 @@ A required module prefixed with `'./'` is relative to the file calling
|
||||
Without a leading `'/'`, `'./'`, or `'../'` to indicate a file, the module must
|
||||
either be a core module or is loaded from a `node_modules` folder.
|
||||
|
||||
If the given path does not exist, `require()` will throw an [`Error`][] with its
|
||||
`code` property set to `'MODULE_NOT_FOUND'`.
|
||||
If the given path does not exist, `require()` will throw a
|
||||
[`MODULE_NOT_FOUND`][] error.
|
||||
|
||||
## Folders as modules
|
||||
|
||||
@@ -1080,7 +1080,7 @@ This section was moved to
|
||||
[`"type"`]: packages.md#type
|
||||
[`ERR_REQUIRE_ESM`]: errors.md#err_require_esm
|
||||
[`ERR_UNSUPPORTED_DIR_IMPORT`]: errors.md#err_unsupported_dir_import
|
||||
[`Error`]: errors.md#class-error
|
||||
[`MODULE_NOT_FOUND`]: errors.md#module_not_found
|
||||
[`__dirname`]: #__dirname
|
||||
[`__filename`]: #__filename
|
||||
[`import()`]: https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports
|
||||
|
||||
Reference in new issue
Block a user