Version
23.8.0
Platform
Ubuntu Mate 24.04.2 LTS (Linux 6.8.0-55-generic x86_64)
Subsystem
repl
What steps will reproduce the bug?
Run
node -e 'console.log(require("node:repl").builtinModules)'
and
node -e 'console.log(require("node:module").builtinModules)'
and notice how the modules printed in the first command are only a subset of those printed by the second
As you can see here:

How often does it reproduce? Is there a required condition?
It can be always reproduced and there is no required condition
What is the expected behavior? Why is that the expected behavior?
According to the REPL documentation (permalink) repl.builtinModules should contains a list of the names of all Node.js modules
What do you see instead?
Only a subset of the list
Additional information
-
(unless I'm mistaken) repl.builtinModules is basically just the same thing as the deprecated and removed repl._builtinLibs, in its deprecation note it is also stated that the list was incomplete
-
Modules not included in repl.builtinModules are available in the repl itself (e.g. node:test and node:sea)
(so it's not like repl.builtinModules includes only modules available in the repl)
-
The deprecation note does recommend to use require('node:module').builtinModules instead, so maybe repl.builtinModules should just be deprecated and removed?
Version
23.8.0
Platform
Subsystem
repl
What steps will reproduce the bug?
Run
node -e 'console.log(require("node:repl").builtinModules)'and
node -e 'console.log(require("node:module").builtinModules)'and notice how the modules printed in the first command are only a subset of those printed by the second
As you can see here:

How often does it reproduce? Is there a required condition?
It can be always reproduced and there is no required condition
What is the expected behavior? Why is that the expected behavior?
According to the REPL documentation (permalink)
repl.builtinModulesshould contains a list of the names of all Node.js modulesWhat do you see instead?
Only a subset of the list
Additional information
(unless I'm mistaken)
repl.builtinModulesis basically just the same thing as the deprecated and removedrepl._builtinLibs, in its deprecation note it is also stated that the list was incompleteModules not included in
repl.builtinModulesare available in the repl itself (e.g.node:testandnode:sea)(so it's not like
repl.builtinModulesincludes only modules available in the repl)The deprecation note does recommend to use
require('node:module').builtinModulesinstead, so mayberepl.builtinModulesshould just be deprecated and removed?