0

I've created a file in visual studio code with the following line:

console.log("Hello World");

I get the following error:

"[Running] node "c:\Users\boyce\Documents\javascript visual studio code\scratchpad-1.js" 'node' is not recognized as an internal or external command, operable program or batch file."

I've also tried running by opening Chrome, but I get error in that application: local host refused cannot connect.

2
  • 2
    you need to have node installed. And if you want to use the browser, you'll have to run the code in the browser's dev console Commented Feb 9, 2021 at 0:08
  • If you want to use "node" as a command, you also need to make sure to add it as a path variable. Commented Feb 9, 2021 at 0:21

1 Answer 1

1

Your browser runs the JS code because it compiles your code using V8 JavaScript engine. If you want to run your JS codes outside of your browser you need have Node.js installed which uses the same engine on the server side.

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

Comments

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.