Need help with error - ( prompt not declared)


Need help with error whenever i run the code - ( prompt not declared)

Repl link:

let a = Prompt ("What is your age ?")

Hey @AyushThakur43!

The prompt command was removed from Replit’s Node.js template, if you’d like to continue to use it add:

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

To the top of your code.


Shouldn’t it be const Prompt not const prompt
Idk i just ran this code in replit and that’s how it work for me
I have never coded in node so this is just a suggestion

You could call the function whatever you wanted really.

1 Like