- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 33.7k
 
Open
Labels
cliIssues and PRs related to the Node.js command line interface.Issues and PRs related to the Node.js command line interface.esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.experimentalIssues and PRs related to experimental features.Issues and PRs related to experimental features.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.
Description
- Version: v14.0.0-pre / cf5ce2c
 - Platform: 
Linux lt2.cfware.com 5.3.11-200.fc30.x86_64 #1 SMP Tue Nov 12 19:25:25 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux - Subsystem: repl, CLI 
--evaland--printwithout--input-type=module 
Create script.mjs:
console.log('script.mjs', typeof require);Running node ./script.mjs or node --input-type=module --eval "import('./script.mjs')" both produce the correct output script.mjs undefined.
Now run import('./script.mjs') in repl, this produces output script.mjs function.  Same for node --eval "import('./script.mjs')".
Using --print in place of --eval does not change typeof require.
CC @nodejs/modules-active-members
Metadata
Metadata
Assignees
Labels
cliIssues and PRs related to the Node.js command line interface.Issues and PRs related to the Node.js command line interface.esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.experimentalIssues and PRs related to experimental features.Issues and PRs related to experimental features.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.