admin管理员组文章数量:1391937
I am trying to console log a piece of JavaScript code through Node.Js but the terminal is not showing any output.
const pokemon = require('pokemon');
pokemon.all();
var name = pokemon.random();
console.log(name);
Can't even console log a simple line of code
console.log("Hello");
Image of terminal after executing node file
I am trying to console log a piece of JavaScript code through Node.Js but the terminal is not showing any output.
const pokemon = require('pokemon');
pokemon.all();
var name = pokemon.random();
console.log(name);
Can't even console log a simple line of code
console.log("Hello");
Image of terminal after executing node file
Share Improve this question edited May 9, 2020 at 5:36 h3t1 1,2462 gold badges19 silver badges32 bronze badges asked May 9, 2020 at 3:26 Prabhnoor SinghPrabhnoor Singh 591 silver badge2 bronze badges 1- 1 post the plete code of file – Lint Commented May 9, 2020 at 3:39
2 Answers
Reset to default 3It is possible that you use node which is not a nodejs package but another. If you type node
on mand line, do you see something like this? Especially the message Wele to Node.js vxx.xx.x.
hanania@laptop:~$ node
Wele to Node.js v12.16.3.
Type ".help" for more information.
>
just try to check out if nodejs is installed successfully on your device by runing
node --version
and if it doesn't respond with nodejs version you need to reinstall nodejs
本文标签: javascriptConsolelog not displaying any output (NodeJs)Stack Overflow
版权声明:本文标题:javascript - Console.log not displaying any output (NodeJs) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744745604a2622858.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论