node.js scripts runs in editor, but does not when packaged as standalone

Dave M's icon

I have a simple patch that uses node (mostly a wrapper around ws to allow websocket communications from the patch). It runs fine from inside the Max editor.

When I bundle it all up as a standalone, it doesn't start the node script. In the console, I see the error:

> node.script: Node script not running, can't handle message send

I have a toggle monitoring the state of the node script object. It never turns on (I have it update every 60 seconds, issuing a `script start` message should it need to)

I've enabled CEF support in the standalone export. Everything else runs fine, including some JSUI for other parts of the project. The code is definitely part of the project, and is error-free.

Any suggestions as to why I'm enjoying this behaviour?

Source Audio's icon

Try to to copy Node for Max folder manually into standalone packages
Unfortunately it includes bunch of not needed stuff,
like binaries for both platforms, examples, man, docs etc
But that can be removed to keep size a bit down, it is bad enough to have to
use CEF Framework...

Florian Demmer's icon

Have you verified that all parts / necessary dependencies are packaged with your standalone?

The Node For Max - Working with Projects, Devices and Standalones guide has detailed information on how to achieve that.

Dave M's icon

Thanks for the suggestions, Florian and Source Audio - there's some useful suggestions there I'll look into when I have a moment to attack it again. There's some stuff I can see I immediately got wrong in your link, Florian :)