question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work with readline on Windows

See original GitHub issue
  • Versions: node@v14.15.4, win32@10.0.19042
  • nodemon -v: 2.0.7
  • Operating system/terminal environment (powershell, gitshell, etc): Windows 10. win32 x64 cmd.exe
  • Using Docker? What image: N/A
  • Command you ran: nodemon app.js

Steps to reproduce

app.js

const readline = require('readline');
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
rl.question('Enter anything: ', (answer) => {
  console.log(answer);
  rl.close();
});
nodemon app.js

Enter text and press enter.

Expected behaviour

App should exit.

Enter anything: a
a
[nodemon] clean exit - waiting for changes before restart

Actual behaviour

App does not exit, continually displays input text. Must exit with Ctrl+C.

Enter anything: a
a
a
b
c
d

If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens. (Some sections redacted with xxx)

--------------
node: v14.15.4
nodemon: 2.0.7
command: xxx\node.exe xxx\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.js app.js --dump
cwd: xxx
OS: win32 x64
--------------
{
  run: false,
  system: { cwd: 'xxx' },
  required: false,
  dirs: [ 'xxx' ],
  timeout: 1000,
  options: {
    dump: true,
    ignore: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**',
      re: /.*.*\/\.git\/.*.*|.*.*\/\.nyc_output\/.*.*|.*.*\/\.sass\-cache\/.*.*|.*.*\/bower_components\/.*.*|.*.*\/coverage\/.*.*|.*.*\/node_modules\/.*.*/
    ],
    watch: [ '*.*', re: /.*\..*/ ],
    monitor: [
      '*.*',
      '!**/.git/**',
      '!**/.nyc_output/**',
      '!**/.sass-cache/**',
      '!**/bower_components/**',
      '!**/coverage/**',
      '!**/node_modules/**'
    ],
    ignoreRoot: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**'
    ],
    restartable: 'rs',
    colours: true,
    execMap: { py: 'python', rb: 'ruby', ts: 'ts-node' },
    stdin: true,
    runOnChangeOnly: false,
    verbose: false,
    signal: 'SIGUSR2',
    stdout: true,
    watchOptions: {},
    execOptions: {
      script: 'app.js',
      exec: 'node',
      args: [],
      scriptPosition: 0,
      nodeArgs: undefined,
      execArgs: [],
      ext: 'js,mjs,json',
      env: {}
    }
  },
  load: [Function (anonymous)],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [],
  watchInterval: null,
  signal: 'SIGUSR2',
  command: {
    raw: { executable: 'node', args: [ 'app.js' ] },
    string: 'node app.js'
  }
}
--------------

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
remycommented, Jul 27, 2022

Any reason why you’re not using --no-stdin flag, as per nodemon --help options?

Because I get this:

SCR-20220727-pfo

0reactions
wyckstercommented, Jul 29, 2022

@remy alluding to the fact that --no-stdin is required in this case explains it well enough for me. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

python's readline module not available for windows?
I have recently faced the same issue on Windows 10. readline is not available for Windows, however there is pyreadline3 (a continuation of ......
Read more >
There's no readline module on Windows Python (cmd.Cmd)
> The Windows cmd implementation clearly uses readline or > some compatible lib under the hood The REPL shell and input() call PyOS_Readline()....
Read more >
Readline for Windows - GnuWin32
The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are...
Read more >
Using Readline In Python REPL On Windows With ...
Use PyReadline and PtPython to have the powerful Readline in Python REPL on Windows OS.
Read more >
import readline is failing · Issue #394 · 3b1b/manim - GitHub
I am trying to run examples_scenes.py and it threw a ModuleNotFoundError when it tried to import readline. This should be easy to resolve ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found