简体   繁体   English

与电子应用程序一起包装NodeJS

[英]Packaging NodeJS along with electron application

我正在运行一个电子桌面应用程序,是否可以将它与nodejs服务器设置打包在一起,使其成为一个完整的应用程序或.exe文件?

Electron is already bundled with NodeJS. Electron已经与NodeJS捆绑在一起。 To package the app, install the electron-packager module: 要打包该应用,请安装electron-packager模块:

npm install -g electron-packager

And then package your app with: 然后将您的应用打包:

electron-packager <sourcedir> --platform=<platform> --arch=<arch>

See the linked docs above for more details on how to do this. 有关如何执行此操作的更多详细信息,请参见上面的链接文档。

Or you can save it to your package.json file and create a gulp task to run the packager. 或者,您可以将其保存到package.json文件中,并创建一个gulp任务来运行打包程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM