[英]Is there any difference between .innerHTML and console.log() in terms of displaying/rendering output?
[英]Console.log not displaying any output (NodeJs)
我正在尝试通过 Node.Js 控制台记录一段 JavaScript 代码,但终端未显示任何 output。
const pokemon = require('pokemon');
pokemon.all();
var name = pokemon.random();
console.log(name);
甚至不能控制台记录一行简单的代码
console.log("Hello");
您可能使用的节点不是 nodejs package 而是另一个。 如果你在命令行输入node
,你会看到这样的东西吗? 特别是Welcome to Node.js vxx.xx.x.
的消息。
hanania@laptop:~$ node
Welcome to Node.js v12.16.3.
Type ".help" for more information.
>
只需尝试通过运行检查 nodejs 是否已成功安装在您的设备上
node --version
如果它没有响应 nodejs 版本,您需要重新安装 nodejs
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.