javascript - 控制台在Nodejs中没有方法 'debug'?

标签 javascript node.js console

console.debug()函数可以在浏览器控制台中调用。

但是,在 Nodejs 中调用 console.debug() 时会出现一个错误。

TypeError: Object #<Console> has no method 'debug'
    at Object.<anonymous> (c:\share\node\receive.js:20:9)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:929:3

为什么?有什么方法可以替换 Nodejs 中的 console.debug 吗?

最佳答案

NodeJS 中没有 console.debug() 方法。 Here是控制台对象的文档,因此您可以选择最适合您使用的方法。

关于javascript - 控制台在Nodejs中没有方法 'debug'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28828922/

相关文章:

c# - 检查 Console.ReadLine()!=null

javascript - jQuery:在 onclick 之前触发焦点以获取 Ajax 建议

javascript - 如何使用异步函数作为 Array.filter() 的比较函数?

node.js - 带有异步库的循环内的 Mongoose 异步调用

javascript - 尝试将表单元素保存到 mongoDB 时无法读取未定义错误的属性

python - 是否可以在 IPython 控制台中显示 Pandas 样式?

javascript - 响应式文本框 jQuery Mobile

javascript - 使用 ngMock 对外部站点进行无后端测试

javascript - 使用 JavaScript 隐藏一个 div

c - 如何以 "try"读取 C 中的输入