David,
It sounds like you need to split up your flows into separate directories -- this gives you the option to have different npm modules installed, and each editor and/or dashboard running on different ports. You can start/stop them independently of each other as needed. I'm currently doing this with the 6-7 projects I have set up.
For each user directory, I create a package.json file with the version of node-red, node-red-dashboard, and other modules I need for that project. Then I run npm install inside that directory to load all the modules. Here is an example of what's in one of my package files:
{
"name": "node_red_test",
"version": "0.0.1",
"description": "Project for testing/debugging imported flows",
"private": true,
"dependencies": {
"node-red": "^0.17",
"node-red-contrib-binary": "*",
"node-red-contrib-collector": "*",
"node-red-contrib-journal": "*",
"node-red-contrib-merge": "*",
"node-red-contrib-modbus": "*",
"node-red-contrib-moment": "*",
"node-red-contrib-web-worldmap": "*",
"node-red-node-base64": "*",
"node-red-node-daemon": "*",
"node-red-node-data-generator": "*"
}
}
I modify the settings.js file for each project to set a different port to use for that instance -- this way, I can run multiple instances at once. If you only plan to work on one project at a time, you can just leave the port set to the default value.
Each user directory is underneath a projects directory, where I keep a script (well, a .bat file since i'm on windows) to start each node-red instance. Inside the script is a command like this:
node node-red\red.js -v -u node_red_%1 --title red-%1
so for example, I can pass in "test" as the first argument, and it will use the node_red_test userdir (the -u command line option).
The downside is that I practically need a spreadsheet to keep track of which flows are deployed on which ports. Someday I will figure out how to have one master express application for managing all the node-red instances... Until then, I would be interested in knowing if anybody has set up an Express app to manage starting/stopping their node-red instances?
--
Steve