Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Launch nodejs from Qt5 application
Forum Update on Monday, May 27th 2025

Launch nodejs from Qt5 application

Scheduled Pinned Locked Moved Unsolved General and Desktop
qprocessnode.jswebserver
5 Posts 2 Posters 3.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark81
    wrote on 26 Jun 2016, 16:19 last edited by
    #1

    I have a nodejs application which works fine if launched directly from console.
    If I try to start it using QProcess::start (or even startDetached) in this way:

    m_process->start("nodejs", QStringList() << "/home/pi/server.js");
    

    it seems to start, I see the relevant processes in background but it doesn't really work.
    Because it works if started with the same command from console I'm sure the nodejs code itself is ok.
    The problem seems te be related to QProcess but I don't know in which way (especially when using startDetached!).

    Does anybody have some experience about this?

    M 1 Reply Last reply 26 Jun 2016, 16:51
    0
    • M Mark81
      26 Jun 2016, 16:19

      I have a nodejs application which works fine if launched directly from console.
      If I try to start it using QProcess::start (or even startDetached) in this way:

      m_process->start("nodejs", QStringList() << "/home/pi/server.js");
      

      it seems to start, I see the relevant processes in background but it doesn't really work.
      Because it works if started with the same command from console I'm sure the nodejs code itself is ok.
      The problem seems te be related to QProcess but I don't know in which way (especially when using startDetached!).

      Does anybody have some experience about this?

      M Offline
      M Offline
      Mark81
      wrote on 26 Jun 2016, 16:51 last edited by
      #2

      @Mark81 In detail it do all the stuff but doesn't provide the html pages.
      It's an application like this:

      https://github.com/sabhiram/raspberry-wifi-conf

      which enables hostap, etc... everything ok, but when requested the web pages are not served.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 26 Jun 2016, 21:34 last edited by
        #3

        Hi,

        Did you check the standard output and standard error channels provided by QProcess ? There might be messages in there that will help find what's going on.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        M 1 Reply Last reply 3 Jul 2016, 09:19
        0
        • S SGaist
          26 Jun 2016, 21:34

          Hi,

          Did you check the standard output and standard error channels provided by QProcess ? There might be messages in there that will help find what's going on.

          M Offline
          M Offline
          Mark81
          wrote on 3 Jul 2016, 09:19 last edited by
          #4

          @SGaist Yes, no (unexpected) messages at all

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 3 Jul 2016, 21:16 last edited by
            #5

            Do you have any logging going on that would allow you to check whether your nodejs server does something ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            1/5

            26 Jun 2016, 16:19

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved