alert()

alert()是window对象的方法,并没有在javascript。所以在node.js中运行js文件时会出现alert没有定义。

此时应该使用console.log().

原文地址:https://www.cnblogs.com/jugglee/p/7568222.html