I am trying this command to run my js file to check whether node is installed properly or not.. 'C:\Users\vijay reddy\hello.js' but getting this error
Error: Cannot find module 'C:\Users\vijay reddy\hello.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
if you create a file
hello.js like so:
And you are in the directory it exists in, and run (from your command prompt):
You will get the correct output if node is installed correctly.
To figure out why it's not, try the other commands they suggest. If you try:
and you get nothing, or an error, then that means either Node isn't installed, or it's not in your current users %PATH%.
Also, depending on how you created hello.js, Windows may have "helpfully" changed it to hello.js.txt for you.