Node for Max - node process manager not running


    s4i ko
    Feb 01 2022 | 8:29 am
    I'm trying to get Max to communicate with a web server using Node.js, but I can't get the script running. I know I can only run the script from Max for it to find 'max-api', and I've tried with several examples, but it won't work.
    Each time I press 'script npm install' or 'script start' it will log 'node process manager not running'. If I press 'script reboot' it will try to start it 5 times and say 'Node for Max process manager quit after 5 restarts'.
    I can't find anyone with the same problem, and i really don't know how to solve it. I hope someone will be able to help !
    Thanks already.
    the error log after 'script start', 'script npm install' or 'script reboot'
    the error log after 'script start', 'script npm install' or 'script reboot'

    • Dimitri Aatos's icon
      Dimitri Aatos
      Feb 06 2022 | 12:59 am
      It sounds like there's a syntax error in the code you are trying to run. It would be helpful to see the node console, you can see that if you use the node.script debugging tool. You can find the debugging tool in the [node.script] helpfile. It's a bpatcher you can copy to your patch and connect to your [node.script]. To see the console click the button on the top right corner of the debugging tool.
    • s4i ko's icon
      s4i ko's icon
      s4i ko
      Feb 06 2022 | 11:25 am
      Hello Dimitri,
      Thank you for answering. I believe the debugging tool is already in the patch I'm using. I comes from there, I didn't modify it :
      Here is a screenshot, the debug console says empty when I press any button ('npm install', 'start', 'reboot'...)
      The patch after I tried to start or reboot the script, and installing npm
      The patch after I tried to start or reboot the script, and installing npm
      I guess the problem comes from my machine, I'm already using npm for several websites. Maybe Max isn't allowed to access npm or to start anything. I've tried a global installation of node process manager, without success.
      I also installed it in that folder with the terminal, it successfully reads the package.json.
    • Florian Demmer's icon
      Florian Demmer's icon
      Florian Demmer
      Feb 06 2022 | 7:46 pm
      Hi S4I KO.
      Unless I'm misremembering this already came up on the Github repo, where we suggested to get in touch with the Cycling '74 support? It appears that the Process Manager itself that Node for Max uses internally is failing to start on your machine, which hints at nothing being wrong with your scripts but something else blocking it.
      To confirm are you able to open the node.script help patch and start the examples in there? The easiest way is to just open the node.script help file and see if you use the script start and script stop messages in the basic tab successfully. (debug tool shows a green success banner).
      If not please get in touch with support, who will help figuring out further what might be at odds here as it might in fact be specific to your environment.
      As an aside - no additional or even machine wide install of Node, NPM or any other tool is required and you don't have to use the terminal. In fact, Max ships with everything necessary to run node.script.
    • s4i ko's icon
      s4i ko's icon
      s4i ko
      Feb 07 2022 | 8:08 am
      Dear Florian,
      Indeed, I also asked it in Github. I got the email notification from your answer, I assumed it came also from here, I forgot I did also ask on Github...
      I can't open any script, in the node.script help patch as well.
      I will contact the support right now to figure out what can be going wrong. Sorry for the duplicate topic on both plateforms.
    • Ernests Lavrinovics's icon
      Ernests Lavrinovics's icon
      Ernests Lavrinovics
      Aug 29 2023 | 2:39 pm
      Hey, did you find any solutions on this? I'm experiencing the same issue although I'm running Max with Ubuntu via Wine.