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