我正在关注 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
返回未定义。
最佳答案
我假设您在主进程中执行此操作,如果是这样,您可能需要检查是否在某处安装了另一个 electron
模块,如常见问题解答中所述:https://github.com/atom/electron/blob/v0.36.6/docs/faq/electron-faq.md#requireelectronxxx-is-undefined
关于javascript - Electron 无法读取未定义的属性 getName,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35089343/