Home  >  Q&A  >  body text

centos - 开发的electron软件 运行在linux平台的解决方案

我的软件用electron 开发的。

可以运行在linux没问题。但是要想运行在无图形界面的linux平台。是不是得开发各种命令。
比如 service nginx restart 就是让软件启动。还有停止什么的
比如
electron -v
就是列出软件的版本号。

弱弱的问,在electron里面怎么弄这些功能,好无头绪啊,百度搜索都不知道搜索什么关键词。请指点一二,谢谢。

某草草某草草2733 days ago910

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-04-26 09:03:57

    electron is used to build desktop applications.

    If you want to run it under the console of linux, don’t use linuxconsole下跑起来,就不要使用electron,直接用node.js, just use node.js directly?

    reply
    0
  • 高洛峰

    高洛峰2017-04-26 09:03:57

    It’s okay. However, Electron is actually useless in this case, because the command line interactive output mainly relies on stdout output, not the HTML rendering result. It would be better to use Node.js directly.
    process.argv is the command line parameter, the first two are the electron command and main.js.
    var options = process.argv.slice(2);
    You need to execute it manually instead of using npm.
    node_modules/.bin/electron main.js argv1 argv2
    Process commands in main.js.

    reply
    0
  • Cancelreply