Node.js is not the command line. In the Search bar next to the Start button, type,
and Enter. Now navigate to the folder where your file is,
It should default to,
which can be changed as follows:
Now your node command should work.
...> node hello.js
The Command App is actually quite outdated. Windows has PowerShell which is closer to bash and recognizes some of the bash commands.
Bottom line, invest yourself over time to learn both PowerShell (if you are a Windows user) and bash (whether linux user or not). VS Code might even have bash installed. Check your menus.
Another way to find out if Bash is present would be open Windows Explorer and navigate to a folder that contains a JS file. Right Click. Is ‘Git bash’ in the context menu? Of so, click it and voila. Now you can,
$ node myfile.js
But if VSCode is installing bash, it should have some way to open it within the IDE window. Check at the bottom as well as the top navigation.
Node.js is a terminal for running Node commands. It is a shell within a shell. The outer shell, bash, invokes the node shell as the JS environment. We cannot run JS in bash (or PS or cmd). Node gives us the local support for ECMAScript which does not depend upon a browser.
Open your Chrome browser and Ctrl+Shif+J and you should have a JS console. It is possible to enter JS commands directly at the prompt.
> console.log('Hello World!')
<- Hello World!