JavaScript stuck in beginning

Hi, just bought Moshs JavaScript course and in the beginning im stuck … All the examples he shows is on MacOs system im Windows user. And when I was completing “Getting Started” section “JavaScript In node” I couldnt execute “Hello World” in cmd prompt… all I was getting C:\Users\Liutauras>C:\Users\Liutauras\Desktop\js-basics\indes.js
‘C:\Users\Liutauras\Desktop\js-basics\indes.js’ is not recognized as an internal or external command,
operable program or batch file.
How should I fix this tried with all the dollar signs as in tutorial no result either. used google how to execute file in folder it doesnt show any dollar sign either, but doesnt work either way anyway please help, feeling really angry at my self that I stuck in the beginning…

1 Like

First of all go the your js file directory and run
Node your_filename

How do I do that ? Thank you, you’re the only one to contact me

Also I can run hello world code in VS integrated terminal but not in cmd prompt

I guess you have a typo in your file name. try to rename it to index.js instead of indes.js

Js is a script language which you can not run in IDE, the output shows in console. There are two ways to solve your problem.

  1. build a HTML file simply using ‘!’ and writing your code in a script label, then run the html file using live server and press ‘F12’ check and debug your code in the console.

  2. install ‘code runner’ extension in you VS code, google if you don’t know how to install an extension. then download nodeJS somewhere in your computer, then restart your computer and VS code. you will see a play button on the right top cornor of your ide, you can simply run your js code in ide then. make sure save the file everytime before you run.