我已经使用Node编写了一个Electron应用程序,Electron Boilerplate和phantom。在我的linux机器上,它对我来说工作得非常好,我将源代码复制到了Windows 10,并使用npm start
运行,并且一切顺利。PhantomJS来自Windows上的节点
但是,当我尝试使用npm run release
使用样板模块构建应用程序时,情况会变得不那么顺畅。我可以安装并打开应用程序,但是当我点击激活幻像模块的按钮时,窗户全白,没有任何反应。我能用开发工具记录一些错误。
首先,我有:
C:\...\dist\win-unpacked\resources\app.asar\node_modules\phantom\lib\phantom.js:361
Uncaught (in promise) Error: Error reading from stdin: Error: write EPIPE(…)
我做了一些研究类似的问题,即here,并且在我看来,这个问题开始的子进程,PhantomJS,与故宫模块幻象。最初,我使用的是我在C#中编写的WPF应用程序来启动该过程,并且工作得很好。这让我相信幻影模块是罪魁祸首。
所以,我想换出故宫幻影模块horseman,却得到了类似的结果:
Unhandled rejection HeadlessError: Phantom immediately exited with: 4294967295
at ChildProcess.immediateExit (C:\...\dist\win-unpacked\resources\app.asar\node_modules\node-horseman\node_modules\node-phantom-simple\node-phantom-simple.js:153:23)
at ChildProcess.g (events.js:286:16)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
https://en.wikipedia.org/wiki/File_URI_scheme – 2016-11-05 18:27:39
@Igor有什么特别的你看到错误,或者你是否建议幽灵模块有一个不正确的URI? –
可能Windows安全问题不允许运行未签名的程序。 – Vaviloff