# Why aren't dependencies exported alongside a flow.json?

**URL:** <https://discourse.nodered.org/t/why-arent-dependencies-exported-alongside-a-flow-json/92321>\
**Category:** General\
**Created:** [11 October 2024 16:18 UTC](https://discourse.nodered.org/t/why-arent-dependencies-exported-alongside-a-flow-json/92321 "2024-10-11T16:18:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [11 October 2024 16:18 UTC](https://discourse.nodered.org/t/why-arent-dependencies-exported-alongside-a-flow-json/92321/1 "2024-10-11T16:18:05Z")

</div>

Why aren't dependencies exported alongside a flow.json?  
Someone shared with me his flow.json but he forgot to tell me the dependencies. Now I can't run his flow unless I know the package dependencies.

---

<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 October 2024 16:42 UTC](https://discourse.nodered.org/t/why-arent-dependencies-exported-alongside-a-flow-json/92321/2 "2024-10-11T16:42:35Z")

</div>

Unfortunately, the dependencies are separate to the flow and are stored in the package.json. It would not be safe to share that file. Though not a bad enhancement request for node-red maybe to at least show the dependencies when you export?

There is, however, a rather well hidden web page that will show you what dependencies a flow file has. Paste the flow into there and it should tell you:

[https://flows.nodered.org/inspect](https://flows.nodered.org/inspect)

---

<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 October 2024 16:50 UTC](https://discourse.nodered.org/t/why-arent-dependencies-exported-alongside-a-flow-json/92321/3 "2024-10-11T16:50:39Z")

</div>

> [@AllanOricil](#):
>
> Why aren't dependencies exported alongside a flow.json?

Because the flow JSON is an array and until recently had no means of including meta data. Oh, and the fact it was not designed like that from the outset.

There is a thread (or 10) that discusses flow file format improvements that could (should) hit this very matter (would take me some digging to find)

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [11 October 2024 18:40 UTC](https://discourse.nodered.org/t/why-arent-dependencies-exported-alongside-a-flow-json/92321/4 "2024-10-11T18:40:30Z")

</div>

This 🤪

> <https://github.com/node-red/node-red/pull/4599>
>
> Part of #4597 
> 
> When exporting a flow from the editor (via Ctrl-E, or deployin…g to runtime), the editor will now scan the nodes being exported and if any come from modules other than \`node-red\`, it will include a \`global-config\` node in the export (or update an existing one) to include a \`modules\` object:
> 
> For example: 
> \`\`\`
> {
> "id": "501579b48496ccb7",
> "type": "global-config",
> "modules": {
> "node-red-node-daemon": "0.2.1"
> }
> }
> \`\`\`
> 
> When importing such a flow, if any of the included nodes are unknown, it now prompts the user to install the modules provided in the global-config node list:
> 
> \<img width="527" alt="image" src="https://github.com/user-attachments/assets/e4137aa8-0add-4f3d-aefd-d604456786a6"\>
> 
> Clicking 'manage dependencies' takes you to the Palette Manager's Install tab, with the required modules pre-filtered:
> 
> \<img width="717" alt="image" src="https://github.com/user-attachments/assets/9c613bd2-cbbb-4f27-9bbb-e1e848667423"\>
> 
> Notes:
> 
> - the list of modules is \*not\* saved when the flow is deployed. This means if the user deploys with the unknown nodes in place, then reloads the editor, we no longer have the information needed to offer the install. This is due to the way we don't persist the \`modules\` property of the global config node - it is only ever created on the export action.

---

<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:** [9 January 2025 18:41 UTC](https://discourse.nodered.org/t/why-arent-dependencies-exported-alongside-a-flow-json/92321/5 "2025-01-09T18:41:31Z")

</div>

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