简体   繁体   中英

Why i am not getting output in teminal Nodejs?

function helloworldapp() {
  console.log("Hello World");
} 

I am new to Ndoejs. I have installed node on my windows 10 and in cmd i type node-v it showing me the installed version of nodejs, but when i craeted project on vscode and type node app.js (js file name). it does not showing me any thing in teminal. how can i get output of my nodejs program in terminal? 在此处输入图像描述

You are only defining the function helloworldapp , not calling it.

do helloworldapp() to execute the function

If this is everything you put in the app.js file, you are not calling your function.

function helloworldapp() {
  console.log("Hello world");
}

helloworldapp()

I suggest you follow the nodejs getting started guide. https://nodejs.org/en/docs/guides/getting-started-guide/

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