Node for Max - node process manager not running
Hello,
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.

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.

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 : https://github.com/avantcontra/osc-websocket-example/tree/master/max
Here is a screenshot, the debug console says empty when I press any button ('npm install', 'start', 'reboot'...)

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.
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.
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.
Hey, did you find any solutions on this? I'm experiencing the same issue although I'm running Max with Ubuntu via Wine.
Hello,
I created a standalone with a node for max module. When running the standalone on non-admin user (Standard user in MacOS), I get the error described in this thread. The application runs correctly when running on admin user.
Should any specific access rights be given to non-admin user for the application to run?
Thanks,
Karim
Hi Karim,
Is in fact the Process Manager failing to start or is your script failing to load?
Any chance that you have a minimal example that reproduces the issue? If you prefer, you can also get in touch with our support and feel free to mention my name.
Thanks
Florian
Hi Florian,
I think it is the process manager that is failing to start as the error is shown at the start of the application. The script is started later by the user.
I contacted the support yesterday and I didn't get a reply yet. I didn't submit an example though.
Karim
Hi again Florian,
Here is an example of patcher that reproduces the error for me.
The patcher is part of project of this hierarchy
test.maxproj
node-content
-> node_modules
-> package-lock.json
-> test.js
patchers
-> test.maxpat
the node-content folder is added to the search path (embedded).
Also, I see that node-content was added when building the Application.

Please let me know if I missed anything.
Karim
Hi,
Any news for this issue? I contacted the support but they did not seem sure about solving it.
Karim
Hi Karim,
would you mind telling me what version of Max you are encountering this issue with?
Hi Florian,
its Max 8.1.11.
Hi Karim,
ok thank you. To my knowledge the issue has been addressed since then, from the top of my head in Max 8.2.2 or 8.3.
Have you verified the same behaviour persists with the latest version of Max or does it act as intended?
Hi Florian,
Thanks for your reply.
Yes indeed when I upgraded to 8.2.6, the problem is solved. Thanks a lot for your help.
Karim