电子无法读取未定义的属性getName

时间:2016-01-29 16:28:20

标签: javascript electron

我正在关注http://electron.atom.io/docs/v0.36.5/api/menu/处的Electron菜单示例,但是我收到了错误

Cannot read property 'getName' of undefined

这发生在调用require('electron').app.getName();的位置。

当我打开开发工具并查看时,我看到require('electron')似乎正确加载,但require('electron').app返回undefined。

1 个答案:

答案 0 :(得分:1)

我将假设您在主要流程中执行此操作,如果是这样,您可能需要检查是否在某处安装了另一个electron模块,如FAQ中所述:{ {3}}

相关问题