【发布时间】:2015-12-29 20:57:51
【问题描述】:
我在 Node js 中构建了一个应用程序,它使用 Websockets 将事件传递给浏览器。我想将该应用程序捆绑到一个 .exe 文件中,以便它可以在客户端计算机上运行而无需安装 Node。
我搜索了几种方法,最后使用 Nexe 进行捆绑。 一切正常,但是当我运行输出文件时,Websocket 模块出现问题。
TypeError: WebSocketServer is not a function
at Array.__dirname.call.C:\Users\Raghav Tandon\WinPos\BrowserIntegrat
ion\js\RestImpl.js.http (nexe.js:15287:12)
at initModule (nexe.js:29:11)
at nexe.js:31:64
at Array.__dirname.call.C:\Users\Raghav Tandon\WinPos\BrowserIntegrat
ion\js\RestWS.js../RestImpl (nexe.js:48:20)
at initModule (nexe.js:29:11)
at Array.forEach (native)
at nexe.js:39:8
at nexe.js:46:4
at NativeModule.compile (node.js:945:5)
at Function.NativeModule.require (node.js:893:18)
电子可以工作吗?
请帮助我了解如何将 Node 应用程序捆绑到 .exe 文件。
请分享执行此操作的最佳做法。 TIA
【问题讨论】:
标签: node.js windows websocket exe electron