How to launch specific .json files in Node-Red

Using Windows 10:
In experimenting with Node-Red I've been able to create several flows, and exported as .json files to a folder.
To execute I have a short-cut saved that starts a .cmd (command file) that starts the Node-Red server. Next I click on a short cut [http://127.0.0.1:1880/#flow/403537834f4eaadf] that launches a browser, and the URL field changes to [http://127.0.0.1:1880/#flow/bb1ef1dfee14acb5] and displays the last flow I was working on.

How do I have Node-Red load any of the other flows I've exported instead of reloading the last one I was working on. The only way I've found is to delete all the tabs of the last flow, and import the one I want to work on; surely this can not be right.

I've tried using the command prompt and typing in Node-Red flows.json|{my project name.json}; but I get Node-Red not recognized response.

Is there anyway to create a windows short-cut for each JSON file that will launch in the browser for editing when the server is running?

There's got to be a simple way to edit selected files.

X.

Are you working with the project feature enabled ?

Can you share a screenshot with the command and the error message ?

Andrei,

I was looking for something like a project-mode.
How do you enable the "project feature"?

X.

This question tells me that you are not using Node-RED projects.

So, you should be able to run a flow using the command: node-red flowname.json

Command-line Usage

node-red [-v] [-?] [--settings settings.js] [--userDir DIR]
         [--port PORT] [--title TITLE] [--safe] [flows.json|projectName]
         [-D X=Y|@file]

As I mentioned when I try to run node-red in a command window it says;
'node-red in not recognized as a internal or external command, operable program or batch file.'

So, you are saying that you are unable to run Node-RED ? From your first post I understood that Node-RED is working for you. I am confused now.

In experimenting with Node-Red I've been able to create several flows, and exported as .json files to a folder.

I found the folder ...../npm, where various node-red files are located; including "node-red.cmd".
When the command file is run the server is started. I was then able to get the basic node-red editor loaded in a browser. I began entering flows in the editor; the only way I found to save them was "Export all flows" to a .json file. I saved the browser URL so I could re-launch it after starting the server.

I suspect something went wrong with the installation in windows, but the same thing happened on another PC.

How are you normally running Node-RED? Did you install it globally? Are you in the correct folder or is node-red on your PATH?

I found the folder ...../npm, where various node-red files are located; including "node-red.cmd".
When the command file is run the server is started. I was then able to get the basic node-red editor loaded in a browser. I began entering flows in the editor; the only way I found to save them was "Export all flows" to a .json file. I saved the browser URL so I could re-launch it after starting the server.

I suspect something went wrong with the installation in windows, but the same thing happened on another PC.

Okay, to the basics. How did you install node-red?

I did this maybe 6 months ago, but I believe I followed the installation instructions in the Node-Red guide.
It did install the folder referenced ...'npm. That folder was buried in hidden windows files under "user/appdata/Roaming".

The command file I used to launch the server was in "npm".

This forum response from Steve may help Keeping flows with hostname change? - #2 by Steve-Mcl

BTW: The installation also created entries in the Windows Start menu for Node.js as various related files command file references including an Uninstall Node.js.

Unfortunately, I can't get passed "GO", Node-Red is not recognized as a command or program using the command window. That's what makes me suspicious that the installation is incomplete.

Any suggestions as to how to correct the installation?

after you installed, did you restart PC so that paths were loaded into the coomand line?

NOTE: can you share the EXECT command you used to install npm -g etc

node-red is a convenience script and unless windows is correctly configured, the system won't find it.

If you know where red.js is, you can simply node /path/to/red.js. To avoid future issues, once you've worked out the start command you want, put a "start" script in ~/.node-red/package.json then you can do

cd ~/.node-red
npm start

Noting that the ~ shortcut only works in PowerShell, cmd prompt uses different shortcuts.

Installed the path to red.js; it didn't make any difference.
Probably going to uninstall Node-Red, and start over.

BTW, this is the link I used for the original Node-Red installation:
https://nodered.org/docs/getting-started/windows

Got it running correctly; it was simply a matter of how I was launching the node-red.cmd file. I now get the initial Node-Red development environment.

I now have the capability to launch the development environment two ways; recalling the last project, or initializing a new project.

Thanks to all for your suggestions,
X.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.