ReferenceError: prompt is not defined


<Below this line, add a link to the EXACT exercise that you are stuck at.>
Prompt exercise

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
I wrote a .js file included the prompt command. But I got a “ReferenceError: prompt is not defined” Error after running it using Node.js. Could you please tell me what causes this error? Or what library is needed.


The code is shown below:
prompt(“What’s your name?”);

<do not remove the three backticks above>

To get in idear of what kind of problem you are encountering…
Do a google search in the knowledge-base of the site

== discussions / opinions ==
nodejs "ReferenceError: prompt is not defined
for instance

This Javascript course is presented to you using

  • left-column in which explanation & instructions are presented
  • middle-column in which you will place the required code as asked by the Instructions
  • right-column a redirected display of results generated by your code AFTER
    you have clicked on the submit-button

What you should know
++++ reset of session *****************
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser


Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.