-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Closed
Labels
duplicateIssues and PRs that are duplicates of other issues or PRs.Issues and PRs that are duplicates of other issues or PRs.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.
Description
- Version: v8.7.0
- Platform: Linux nbk-lobo 4.10.0-37-generic Add a Gitter chat badge to README.md #41-Ubuntu SMP Fri Oct 6 20:20:37 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: repl
I normally use the repl, to test out modules before actually using them.
Today I run into an issue that I don't really know if it's an issue or a "feature".
node ⬡ 8.7.0 ◇ 5.5.1 [±PETRO-797-guidon-export ●]
> const m = require('invalid-module-name-goes-here')
Error: Cannot find module 'invalid-module-name-goes-here'
at Function.Module._resolveFilename (module.js:527:15)
at Function.Module._load (module.js:476:23)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at repl:1:11
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at REPLServer.defaultEval (repl.js:239:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:440:10)
> const m = require('invalid-module-name-goes-here')
SyntaxError: Identifier 'm' has already been declared
> m
ReferenceError: m is not defined
at repl:1:1
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at REPLServer.defaultEval (repl.js:239:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:440:10)
at emitOne (events.js:120:20)
at REPLServer.emit (events.js:210:7)
at REPLServer.Interface._onLine (readline.js:282:10)
at REPLServer.Interface._line (readline.js:631:8)
>
(To exit, press ^C again or type .exit)
>
So, basically, you require a non existent module, assigning it to a const identifier. Then, when you try to redefine it (may be typing the correct module name, it doesn't matter much) it says it has been already declared, but after inspecting it, it says it's not defined.
So, weather the last reference error is wrong, saying it's not defined
. Or may be there is a slight difference between defined
and declared
?
Metadata
Metadata
Assignees
Labels
duplicateIssues and PRs that are duplicates of other issues or PRs.Issues and PRs that are duplicates of other issues or PRs.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.