-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repl.builtinModules
doesn't contain all node.js builtin modules
#57504
Comments
repl.builtinModules
doesn't contain all node.js builtin modules
SGTM, would you like to send a PR? |
Yes for sure! I'll get to it right away, but could you clarify the plan here? is the idea to land this as a breaking change for v24 and leave it as is in v23? Or if it makes sense I can fix and deprecating it in v23 and remove it altogether in v24, if that's not too much overhead But I am not sure how to do that (2 PRs one for v23 and one for v24?) could you advice me on how to proceed in this regard? 🙂 🙏 |
Actually sorry it's my bad, Lines 1871 to 1885 in ab9660b
So if we want to follow that I guess the correct solution here is to just deprecate |
The first step is to doc-deprecate it, you can check the history of |
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.builtinModules
should 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.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 incompleteModules not included in
repl.builtinModules
are available in the repl itself (e.g.node:test
andnode: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 mayberepl.builtinModules
should just be deprecated and removed?The text was updated successfully, but these errors were encountered: