nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.45k stars 278 forks source link

Vs Code Error! on Linux-Mint OS #4236

Closed ghost closed 8 months ago

ghost commented 11 months ago

Details

when ever i am using Prompt in js on Vscode it is throwing error again and again.I have also installed npm and all stuff and had also added code that is Prompt sync.....

Node.js version

v18.17.1

Example code

const prompt = require('prompt-sync')();

let name = prompt("what is your name"); console.log(name);

Operating system

Linux MInt

Scope

Error: ENXIO: no such device or address, open '/dev/tty' at Object.openSync (node:fs:603:3)

errno: -6, syscall: 'open', code: 'ENXIO', path: '/dev/tty' }

Node.js v18.17.1

[Done] exited with code=1 in 0.127 seconds

Module and version

Not applicable.

gireeshpunathil commented 11 months ago

what does ls -lrt /dev/tty show?

preveen-stack commented 11 months ago

On kali linux it shows like

ls -lrt /dev/tty
crw-rw-rw 1 root tty 5, 0 Aug 30 03:57 /dev/tty
ghost commented 11 months ago

what does ls -lrt /dev/tty show?

It shows crw-rw-rw- 1 root tty5, 0 Aug 30

gireeshpunathil commented 11 months ago

ok - that means you have the device, and it is accessible.

can you run strace -f node app.js where app.js is your program name and paste the output here?

ghost commented 11 months ago

ok - that means you have the device, and it is accessible.

can you run strace -f node app.js where app.js is your program name and paste the output here?

I run but output is way tooo lengthy something like error

gireeshpunathil commented 11 months ago

I run but output is way tooo lengthy something like error

@luvkapur4 - thanks for running it. Yes, it is expected to be lengthy. Can you post the output in gist ( https://gist.github.com ) and share the link here?