0

Atom is not able to run javascript code for some reason, I have tried both packages such as atom runner and atom script with no success. I have Node JS installed on my computer and javascript package installed on Atom, I have no idea why it does not work. Here is the code which is returned after trying to run a javascript prompt.

 C:\Users\artisan\Desktop\hi.js:1
(function (exports, require, module, __filename, __dirname) { var hi = prompt("wt");
                                                                       ^

ReferenceError: prompt is not defined
    at Object.<anonymous> (C:\Users\artisan\Desktop\hi.js:1:72)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

1 Answer 1

1

prompt() is a function which is implemented by Web Browsers. In serversided JS you can't use this function.

Sign up to request clarification or add additional context in comments.

1 Comment

@CosminGeorge You may want to look into something like livereload or atom-live-server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.