我已經使用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