From 685702ce51fee4c3503b9f5001d51e1993144119 Mon Sep 17 00:00:00 2001 From: Tobias Hernstig <30827238+thernstig@users.noreply.github.com> Date: Fri, 28 Jan 2022 11:16:30 +0100 Subject: [PATCH 1/2] doc: update modules.md wording --- doc/api/modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/modules.md b/doc/api/modules.md index 7c814351a62fa2..fbfa0850f638df 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -481,7 +481,7 @@ folders as modules, and work for both `require` and `import`. If the module identifier passed to `require()` is not a [core](#core-modules) module, and does not begin with `'/'`, `'../'`, or -`'./'`, then Node.js starts at the parent directory of the current module, and +`'./'`, then Node.js starts at the current directory of the current module, and adds `/node_modules`, and attempts to load the module from that location. Node.js will not append `node_modules` to a path already ending in `node_modules`. From 31e96d44044e3e4f3429d8440040a626854e1ef2 Mon Sep 17 00:00:00 2001 From: Tobias Hernstig <30827238+thernstig@users.noreply.github.com> Date: Fri, 28 Jan 2022 12:35:14 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Antoine du Hamel --- doc/api/modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/modules.md b/doc/api/modules.md index fbfa0850f638df..40135a804b8631 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -481,7 +481,7 @@ folders as modules, and work for both `require` and `import`. If the module identifier passed to `require()` is not a [core](#core-modules) module, and does not begin with `'/'`, `'../'`, or -`'./'`, then Node.js starts at the current directory of the current module, and +`'./'`, then Node.js starts at the directory of the current module, and adds `/node_modules`, and attempts to load the module from that location. Node.js will not append `node_modules` to a path already ending in `node_modules`.