Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 未调用Electron节点异步调用_Node.js_Asynchronous_Electron - Fatal编程技术网

Node.js 未调用Electron节点异步调用

Node.js 未调用Electron节点异步调用,node.js,asynchronous,electron,Node.js,Asynchronous,Electron,我在electron下运行的函数中有一些非常基本的测试代码: function test { log.info('this shows') let r = async() => { log.info ('will never show')} // or (async() => {log.info('will not show')}) } 为什么日志行从未出现在日志中?它让我发疯。在你的代码中变量r是函数定义,你必须像r()那样调用函数来触发它。你将r分配给一个函数

我在electron下运行的函数中有一些非常基本的测试代码:

function test {
   log.info('this shows')
   let r = async() => { log.info ('will never show')}
   // or (async() => {log.info('will not show')})
}

为什么日志行从未出现在日志中?它让我发疯。

在你的代码中变量
r
是函数定义,你必须像
r()
那样调用函数来触发它。

你将
r
分配给一个函数,但你从未用
r()
调用过它