Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在努力让节点的 util 函数从 spookyJS 回调中输出任何内容:
var utils = require('utils'); ...spooky code... spooky.on('remote.message', function(msg) { utils.log('message'); // does nothing this.utils.log('message'); // does nothing }
是否可以在这样的回调中访问 util 函数?
问题可能是您试图 requireutils而不是util.
utils
util