# How to launch specific .json files in Node-Red

**URL:** <https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333>\
**Category:** General\
**Created:** [11 August 2022 13:46 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333 "2022-08-11T13:46:48Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)\
**Post date:** [11 August 2022 13:46 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/1 "2022-08-11T13:46:48Z")

</div>

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](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](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.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [11 August 2022 15:43 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/2 "2022-08-11T15:43:10Z")

</div>

> [@xytsrm](#):
>
> 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

Are you working with the project feature enabled ?

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

---

<div class="post-metadata">

**Author:** ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)\
**Post date:** [11 August 2022 16:28 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/3 "2022-08-11T16:28:35Z")

</div>

Andrei,

> [@Andrei](#):
>
> Are you working with the project feature enabled ?

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

X.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [11 August 2022 16:40 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/4 "2022-08-11T16:40:50Z")

</div>

> [@xytsrm](#):
>
> How do you enable the "project feature"?

This question tells me that you are not using [Node-RED projects](https://nodered.org/docs/getting-started/local#running).

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

### Command-line Usage

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

```

---

<div class="post-metadata">

**Author:** ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)\
**Post date:** [11 August 2022 16:46 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/5 "2022-08-11T16:46:53Z")

</div>

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.'

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [11 August 2022 16:55 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/6 "2022-08-11T16:55:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)\
**Post date:** [11 August 2022 17:05 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/7 "2022-08-11T17:05:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [11 August 2022 17:10 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/8 "2022-08-11T17:10:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)\
**Post date:** [11 August 2022 17:12 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/9 "2022-08-11T17:12:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [11 August 2022 17:13 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/10 "2022-08-11T17:13:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)\
**Post date:** [11 August 2022 17:15 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/11 "2022-08-11T17:15:22Z")

</div>

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".

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [11 August 2022 17:25 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/12 "2022-08-11T17:25:14Z")

</div>

This forum response from Steve may help [Keeping flows with hostname change? - #2 by Steve-Mcl](https://discourse.nodered.org/t/keeping-flows-with-hostname-change/32474/2)

---

<div class="post-metadata">

**Author:** ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)\
**Post date:** [11 August 2022 17:28 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/13 "2022-08-11T17:28:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)\
**Post date:** [11 August 2022 17:31 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/14 "2022-08-11T17:31:22Z")

</div>

> [@E1cid](#):
>
> This forum response from Steve may help [Keeping flows with hostname change? - #2 by Steve-Mcl](https://discourse.nodered.org/t/keeping-flows-with-hostname-change/32474/2)

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?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 August 2022 18:05 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/15 "2022-08-11T18:05:19Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [11 August 2022 18:10 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/16 "2022-08-11T18:10:09Z")

</div>

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

```auto
cd ~/.node-red
npm start

```

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

---

<div class="post-metadata">

**Author:** ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)\
**Post date:** [11 August 2022 20:21 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/17 "2022-08-11T20:21:13Z")

</div>

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](https://nodered.org/docs/getting-started/windows)

---

<div class="post-metadata">

**Author:** ![xytsrm](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xytsrm](https://discourse.nodered.org/u/xytsrm)\
**Post date:** [11 August 2022 21:07 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/18 "2022-08-11T21:07:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 October 2022 21:07 UTC](https://discourse.nodered.org/t/how-to-launch-specific-json-files-in-node-red/66333/19 "2022-10-10T21:07:52Z")

</div>

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