Description
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
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 removedrepl._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
andnode:sea
)
(so it's not likerepl.builtinModules
includes only modules available in the repl) -
The deprecation note does recommend to use
require('node:module').builtinModules
instead, so mayberepl.builtinModules
should just be deprecated and removed?