# Update Flow from File System - But what about the Dependencies?

**URL:** <https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675>\
**Category:** General\
**Created:** [7 October 2022 11:24 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675 "2022-10-07T11:24:08Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [7 October 2022 11:24 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/1 "2022-10-07T11:24:08Z")

</div>

Continuing the discussion from [Updating a Node-RED flow from the file system](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205):

> [@Updating a Node-RED flow from the file system](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205/1):
>
> If for example I have 10 machines with Node-RED, I would like to be able to update their flow and deploy it without having to go through the Node-RED GUI, but simply by modifying a file via SSH.

The solution proposed in that thread does, indeed, work.

But what if your new "Flow" has some extra dependencies - how would one also get them onto the target machine(s)?

Preferably, via the Dashboard - so that a user can click an 'Update' button ...

See also: [https://discourse.nodered.org/t/re-updating-a-node-red-flow-from-the-file-system](https://discourse.nodered.org/t/re-updating-a-node-red-flow-from-the-file-system)

---

<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:** [7 October 2022 11:43 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/2 "2022-10-07T11:43:21Z")

</div>

Assuming you are doing step 6 "Copy the ".json" file from the temporary folder to "./node-red", the package file will include necessary dependencies. So before launching node-red, execute `npm i`

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [7 October 2022 11:59 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/4 "2022-10-07T11:59:49Z")

</div>

Is there a way to do that just from the dashboard?

I've got the Dashboard doing the upload, copy, and restart - but it restarts with:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/5/15aae3f885819341c674e65f0dc11aea8ea907c2.png)

In the log I see "_[info] Waiting for missing types to be registered:_" and a list of a few modules

---

<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:** [7 October 2022 12:00 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/5 "2022-10-07T12:00:51Z")

</div>

As I said...

> [@Steve-Mcl](#):
>
> Assuming you are doing step 6 "Copy the ".json" file from the temporary folder to "./node-red", the package file will include necessary dependencies. So before launching node-red, execute `npm i`.

So before restarting, run `npm i` inside the `.node-red` folder.

You already have the actions setup to make the dashboard trigger the copy+restart just modify whatever you do to do copy-`npm i`-restart

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [10 October 2022 13:45 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/6 "2022-10-10T13:45:20Z")

</div>

`npm -i` doesn't seem to have made any difference:

```auto
pi@raspberrypi:~/.node-red $ sudo npm i
up to date in 13.079s

1 package is looking for funding
  run `npm fund` for details

pi@raspberrypi:~/.node-red $ node-red-restart
Restarted Node-RED
pi@raspberrypi:~/.node-red $

```

But then the dashboard still doesn't start:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/b/dbd148ad2cb4a273cfddeb2341c760c3042d7829.png)

and the log still ends with:

```auto
---------------------------------------------------------------------
27 Aug 19:52:27 - [info] Waiting for missing types to be registered:
27 Aug 19:52:27 - [info] - simpletime
27 Aug 19:52:27 - [info] - moment
27 Aug 19:52:27 - [info] - func-exec
27 Aug 19:52:27 - [info] - bcrypt

```

---

<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:** [10 October 2022 13:49 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/7 "2022-10-10T13:49:13Z")

</div>

> [@awneil](#):
>
> `sudo npm i`

dont ever use `sudo` unless told to do so 🙂

> [@awneil](#):
>
> `Waiting for missing types to be registered`

Did you actually copy the `package.json` file from the working machine to the new one?

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [10 October 2022 13:55 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/8 "2022-10-10T13:55:38Z")

</div>

> [@Steve-Mcl](#):
>
> id you actually copy the `package.json` file from the working machine to the new one?

no - that wasn't mentioned in the previous thread...

---

<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:** [10 October 2022 13:58 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/9 "2022-10-10T13:58:44Z")

</div>

> [@awneil](#):
>
> that wasn't mentioned in the previous thread.

> [@Steve-Mcl](#):
>
> Assuming you are doing step 6 "Copy the ".json" file from the temporary folder to "./node-red", the package file will include necessary dependencies. So before launching node-red, execute `npm i`

ummmm ☝

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [10 October 2022 14:01 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/10 "2022-10-10T14:01:41Z")

</div>

it just talks about copying the flows.json file?

---

<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:** [10 October 2022 14:05 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/11 "2022-10-10T14:05:26Z")

</div>

so it does (i mis-read `6. Copy the ".json" file from the temporary folder to "./node-red".` as `6. Copy the ".json" files from the temporary folder to "./node-red".`)

OK, then `npm i` wont make any difference because you do not have the original package.json.

FYI: package.json contains a dependency list of node-red nodes to install. So without that, you would have to manually install missing node.s

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [10 October 2022 14:06 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/12 "2022-10-10T14:06:16Z")

</div>

Hmmm ... the **working** one doesn't seem to have a `package.json` file!

It does have `package-lock.json` - but no `package.json` !

EDIT

Well, it _ **is** _ there - but the RPi file explorer is just not showing it!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 October 2022 14:45 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/13 "2022-10-10T14:45:35Z")

</div>

Usually you should copy everything in the .node-red folder except the node\_modules folder.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [10 October 2022 14:54 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/14 "2022-10-10T14:54:04Z")

</div>

> [@Steve-Mcl](#):
>
> OK, then `npm i` wont make any difference because you do not have the original package.json

After adding the `package.json`, the `npm i` does now attempt some stuff, but fails:

```auto
17 silly fetchPackageMetaData error for node-red-contrib-bcrypt@~0.1.3 request to https://registry.npmjs.org/node-red-contrib-bcrypt failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
18 silly fetchPackageMetaData error for node-red-contrib-func-exec@~0.1.11 request to https://registry.npmjs.org/node-red-contrib-func-exec failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
19 silly fetchPackageMetaData error for node-red-contrib-moment@~4.0.0 request to https://registry.npmjs.org/node-red-contrib-moment failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
20 silly fetchPackageMetaData error for node-red-contrib-simpletime@~2.10.0 request to https://registry.npmjs.org/node-red-contrib-simpletime failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
21 silly fetchPackageMetaData error for node-red-contrib-bcrypt@~0.1.3 request to https://registry.npmjs.org/node-red-contrib-bcrypt failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
22 silly fetchPackageMetaData error for node-red-contrib-func-exec@~0.1.11 request to https://registry.npmjs.org/node-red-contrib-func-exec failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
23 silly fetchPackageMetaData error for node-red-contrib-moment@~4.0.0 request to https://registry.npmjs.org/node-red-contrib-moment failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
24 silly fetchPackageMetaData error for node-red-contrib-simpletime@~2.10.0 request to https://registry.npmjs.org/node-red-contrib-simpletime failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org

```

Googling suggests that `EAI_AGAIN` is likely due to internet access problems - which makes sense here.

So I think that answers the original question, but leaves me to sort out the access.

> [@Colin](#):
>
> Usually you should copy everything in the .node-red folder except the node\_modules folder.

So what's in the node\_modules folder? Would also copying that (potentially) get around the internet access problems?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 October 2022 14:57 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/15 "2022-10-10T14:57:21Z")

</div>

> [@awneil](#):
>
> Would also copying that (potentially) get around the internet access problems?

If your destination machine is identical architecture and OS and has exactly the same nodejs version then probably copying node\_modules too would provide a working system. If any of those is different then all bets are off. The `npm i` command installs and, if necessary, builds all the extra nodes your require so they are compatible with your version of hardware/OS/nodejs version.

---

<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:** [24 October 2022 14:58 UTC](https://discourse.nodered.org/t/update-flow-from-file-system-but-what-about-the-dependencies/68675/16 "2022-10-24T14:58:02Z")

</div>

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