Skip to content

Node in terminal window gives error - Cannot read property 'setRawMode' of null #41330

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
5saviahv opened this issue Dec 26, 2021 · 0 comments · Fixed by #43803
Closed

Node in terminal window gives error - Cannot read property 'setRawMode' of null #41330

5saviahv opened this issue Dec 26, 2021 · 0 comments · Fixed by #43803
Labels
tty Issues and PRs related to the tty subsystem.

Comments

@5saviahv
Copy link

5saviahv commented Dec 26, 2021

Version

17.3.0

Platform

Linux JPC 5.4.0-77-generic #86~18.04.1-Ubuntu SMP Fri Jun 18 01:23:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

tty

What steps will reproduce the bug?

  • open terminal window
  • start node
  • type: process.stdin.push(null)

How often does it reproduce? Is there a required condition?

it happens every time

What is the expected behavior?

  • show false
  • set terminal in not 'raw' mode
  • exit node

What do you see instead?

I see error message also

output:

joe@JPC:~/Downloads/Node/node-v17.3.0-linux-x64/bin$ ./node 
Welcome to Node.js v17.3.0.
Type ".help" for more information.
> process.stdin.push(null)
false
> node:tty:75
  const err = this._handle.setRawMode(flag);
                           ^

TypeError: Cannot read properties of null (reading 'setRawMode')
    at ReadStream.setRawMode (node:tty:75:28)
    at REPLServer.[_setRawMode] [as _setRawMode] (node:internal/readline/interface:350:18)
    at REPLServer.close (node:internal/readline/interface:493:24)
    at REPLServer.<anonymous> (node:repl:1048:7)
    at Object.onceWrapper (node:events:509:28)
    at REPLServer.emit (node:events:390:28)
    at REPLServer.emit (node:domain:475:12)
    at onwritten (node:internal/repl/history:149:14)
    at FSReqCallback.wrapper [as oncomplete] (node:fs:801:5)
    at FSReqCallback.callbackTrampoline (node:internal/async_hooks:130:17)

Node.js v17.3.0
joe@JPC:~/Downloads/Node/node-v17.3.0-linux-x64/bin$ 

Additional information

In node v0.12 & v4 it behaves like expected
In node v6, v8, v10, v12, v14, v16, v17 it gives this error

@VoltrexKeyva VoltrexKeyva added the tty Issues and PRs related to the tty subsystem. label Dec 28, 2021
aduh95 added a commit to aduh95/node that referenced this issue Jul 12, 2022
aduh95 added a commit to aduh95/node that referenced this issue Aug 1, 2022
nodejs-github-bot pushed a commit that referenced this issue Aug 24, 2022
Fixes: #41330
PR-URL: #43803
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
sidwebworks pushed a commit to sidwebworks/node that referenced this issue Aug 26, 2022
Fixes: nodejs#41330
PR-URL: nodejs#43803
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
RafaelGSS pushed a commit that referenced this issue Sep 5, 2022
Fixes: #41330
PR-URL: #43803
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Fyko pushed a commit to Fyko/node that referenced this issue Sep 15, 2022
Fixes: nodejs#41330
PR-URL: nodejs#43803
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
targos pushed a commit that referenced this issue Sep 16, 2022
Fixes: #41330
PR-URL: #43803
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
juanarbol pushed a commit that referenced this issue Oct 10, 2022
Fixes: #41330
PR-URL: #43803
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
juanarbol pushed a commit that referenced this issue Oct 11, 2022
Fixes: #41330
PR-URL: #43803
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this issue Jan 3, 2023
Fixes: nodejs/node#41330
PR-URL: nodejs/node#43803
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this issue Jan 3, 2023
Fixes: nodejs/node#41330
PR-URL: nodejs/node#43803
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
tty Issues and PRs related to the tty subsystem.
Projects
None yet
2 participants