最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - console.log not displaying anything in the terminal (node JS) - Stack Overflow

programmeradmin2浏览0评论

im still very new to nodeJS and i have run into a problem.

whenever i try to log something from my aplication to the terminal using " node [application name]" nothing happen please help if you can, thank you!

please keep in mind that it was working before so i broke it

i have already tried to use another terminal (bash) and nothing happend; but for some reason when i use nodemon it works im very confused so any thing will be helpful

CODE:

console.log('hello world...');

TERMINAL:

PS C:\Users\nsc\Desktop\npm> node app

PS C:\Users\nsc\Desktop\npm> 

im still very new to nodeJS and i have run into a problem.

whenever i try to log something from my aplication to the terminal using " node [application name]" nothing happen please help if you can, thank you!

please keep in mind that it was working before so i broke it

i have already tried to use another terminal (bash) and nothing happend; but for some reason when i use nodemon it works im very confused so any thing will be helpful

CODE:

console.log('hello world...');

TERMINAL:

PS C:\Users\nsc\Desktop\npm> node app

PS C:\Users\nsc\Desktop\npm> 
Share Improve this question edited Aug 22, 2021 at 10:11 Thatkookooguy 7,0421 gold badge33 silver badges59 bronze badges asked Aug 22, 2021 at 10:07 ArabDROPSArabDROPS 1011 silver badge7 bronze badges 3
  • hey ArabDROPS! Wele! is there any more information you can share? maybe explain what you did that broke the normal behavior? it's hard to help you fix this with only the information you provided. thanks! – Thatkookooguy Commented Aug 22, 2021 at 10:10
  • Seems odd. I can see your using powershell, does it do the same using standard cmd shell?. If so it's maybe some funky powershell settings rather than node.. – Keith Commented Aug 22, 2021 at 10:37
  • Did you save your file? – Nick Parsons Commented Aug 22, 2021 at 10:55
Add a ment  | 

2 Answers 2

Reset to default 5

turned out that the problem was i did not save the file, if your having the same issue please try to save before runing.

run the file with .js extensions your run only with filename node app

try to run node app.js

发布评论

评论列表(0)

  1. 暂无评论