问题
I'm trying to use sqlite3 nodejs add-on in my Electron app. I encountered an error while just loading the sqlite3 module. Looking at the stack trace of the crash I see that sqlite3 has several dependencies and one of them being a logging library (npmlog). This library tries to initialize some logging objects from process.stderr
. It crashes because process.stderr
is undefined.
When I check the value of process.stderr
from DevConsole, I see that it's indeed undefined.
Looking at the Electron documentation of process module, I see that it's supposed to be an extended version of nodejs's process
module. Since nodejs has process.stderr
defined, I'm not sure why it's not defined in Electron.
Any ideas?
来源:https://stackoverflow.com/questions/38997260/in-electron-process-stderr-is-not-defined