Using a Node.js library in a Max for Live device

Hi everyone, so I'm building a small app that sends a message over websockets to Max/MSP and I've hit a wall in development.

Won't get into too many details, but basically, i have a node.script object in my Max patch that needs to be able to load the websockets node module with a require(ws) statement.

This is working fine in standalone Max/msp, but I want to be able to run this patch inside Ableton. If I export my max patcher inside a Max project as an M4L device, it's no longer able to load the websockets library.

I've referred to this documentation: https://docs.cycling74.com/legacy/max8/vignettes/03_n4m_projects_devices#Node_for_Max_and_Projects

where they say you have to place the node_modules folder and associated package.json in the project's search path. Okay, that's fine, I added a folder for node content and added it to the search path, and checked the "embedded" checkbox.

I sent a "script npm install ws" message into my node.script object, and the node.debug object reports that the process ran successfully, but no node_modules folder appears in my project folder! I'm at my wit's end trying to get this to work, any help would be appreciated here.

Posted Apr 8, 2026, 1:14 PM UTC

32
Loading comments…