Benjamin Boyce
Benjamin Boyce

Reputation: 405

unable to run javascript code in visual studio code

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.

Upvotes: 0

Views: 1116

Answers (1)

devMob
devMob

Reputation: 60

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.

Upvotes: 1

Related Questions