Home > Enterprise >  Cannot run a simple Hello World program using nodejs
Cannot run a simple Hello World program using nodejs

Time:01-01

After downloading Node.js and Visual Studio Code and after setting up the folders and changing it into respective directories using command lines inside the integrated powershell of VS Code, the 'node app.js' command fails to run the Hello World program. I wrote 'node' along with the full name of the directory and the filename app.js, still its unable to run it. I have attached the screenshot of it.

enter image description here

CodePudding user response:

You forgot to save your file, In VSCode - a white dot next to the file indicates unsaved changes to the file. Save your file Ctrl S and fire off node app.js like that :

enter image description here

CodePudding user response:

Looks like you haven't saved your file. Save it and try to execute it again.

  • Related