renderer.js:10 Uncaught ReferenceError: process is not defined at getProcessInfo (renderer.js:10
在用electron读取process属性和方法时会出现这样的错误。
原因:
在启动window的时候少写了一个参数 nodeIntegration: true,那么有一些对象就不能被正常使用。
最新的[email protected]系列中,这个nodeIntegration参数,默认改成false了。而在以前版本的electron中,这个nodeIntegration参数,默认为true。
解决:
在BrowserWindow中加上nodeIntegration: true
问题解决!真是个大坑!!!