简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM