Node.js v17.9.0 [Done] exited with code=1 in 0.641 seconds [Running] node "/Users/ahmadnasser/Desktop/hhjj.js" node:internal/fs/utils:345 throw err; Error: ENXIO: no such device or address, open '/dev/tty' at Object.openSync (node:fs:586:3) at prompt (/Users/ahmadnasser/node_modules/prompt-sync/index.js:67:10) at Object. (/Users/ahmadnasser/Desktop/hhjj.js:22:9) at Module._compile (node:internal/modules/cjs/loader:1099:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:975:32)
Node.js v17.9.0 [Done] exited with code=1 in 0.641 seconds [Running] node "/Users/ahmadnasser/Desktop/hhjj.js" node:internal/fs/utils:345 throw err; Error: ENXIO: no such device or address, open '/dev/tty' at Object.openSync (node:fs:586:3) at prompt (/Users/ahmadnasser/node_modules/prompt-sync/index.js:67:10) at Object. (/Users/ahmadnasser/Desktop/hhjj.js:22:9) at Module._compile (node:internal/modules/cjs/loader:1099:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:975:32)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
Error: ENXIO: no such device or address, open '/dev/tty'
I have another problem when I run the code in "js"
const prompt = require("prompt-sync")();
// checking whether it is prime or not
function isPrime(n){
if(n <=1)
console.log("False");
varc = 2;
varbool = true;
while(c*c <= n){
if(n % c === 0){
bool = false;
break;
}
c++;
}
// displaying reuslt
if(bool === false)
console.log("False");
else
console.log("True");
}
// entering number
var n = prompt("Enter a positive number:");
isPrime(n);
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY