# Automate Installation of Missing Node Types

**URL:** <https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755>\
**Category:** General\
**Created:** [9 July 2020 05:00 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755 "2020-07-09T05:00:33Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrSidX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrsidx/32/18935_2.png) [@mrSidX](https://discourse.nodered.org/u/mrSidX)\
**Post date:** [9 July 2020 05:00 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/1 "2020-07-09T05:00:33Z")

</div>

I am setting up a "popup tent" server that will auto install node-red via a script and import a flow that will result in missing node types by default. I can install these manually via the 'Manage Palette', but I need it to do it automatically.

Is there a way to automate the installation of the missing node types, so things can install and have the flows working "out the box" after a node-red script install??

Further:  
This is going on a cheap, low memory droplet, and when I did an` npm install` , it would eat up the memory and result in a `Cannot allocate memory` error, and lock up my server, making basic commands throw that same error.

---

<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:** [9 July 2020 06:01 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/2 "2020-07-09T06:01:48Z")

</div>

The solution to the first part is to also provide package.json and package-lock.json then to run `npm install` in the .node-red folder, which will automatically install the required nodes.

I don't know of any solution to the second problem other than pay for more memory.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [9 July 2020 07:37 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/3 "2020-07-09T07:37:50Z")

</div>

Your two options are either just copy over the package.json and run npm install which you say blows memory, or to zip up the .node-red/node\_modules dir and move it over and unzip 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:** [9 July 2020 10:13 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/4 "2020-07-09T10:13:41Z")

</div>

> [@dceejay](#):
>
> zip up the .node-red/node\_modules dir and move it over and unzip it

Am I right in thinking that may not work if the source and destination have different versions of nodejs or the hardware is different? Does the OS matter?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [9 July 2020 11:15 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/5 "2020-07-09T11:15:06Z")

</div>

yes absolutely it may matter - but if it goes bang trying to install "properly" then it may be solution if they have a golden master that can be copied across.

---

<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:** [9 July 2020 12:39 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/6 "2020-07-09T12:39:56Z")

</div>

Agreed, just wanted @mrSidX to realise that there is a possibility that this solution may not work.

---

<div class="post-metadata">

**Author:** ![mrSidX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrsidx/32/18935_2.png) [@mrSidX](https://discourse.nodered.org/u/mrSidX)\
**Post date:** [9 July 2020 15:13 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/7 "2020-07-09T15:13:16Z")

</div>

This makes sense, as these two solutions were in my "trial and error" queue. I will try these and report back. [`Thank you`]

For the sake of being on the cloud with minimal RAM, I think solution of copying the whole `node_modules` over would be best, as I want to avoid crashing the cloud server.

---

<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:** [9 July 2020 15:29 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/8 "2020-07-09T15:29:30Z")

</div>

If your development machine has the same version of nodejs, the same hardware architecture and the same OS and version as the server then you should be ok.

---

<div class="post-metadata">

**Author:** ![mrSidX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrsidx/32/18935_2.png) [@mrSidX](https://discourse.nodered.org/u/mrSidX)\
**Post date:** [9 July 2020 20:20 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/9 "2020-07-09T20:20:11Z")

</div>

I was able to copy the node\_modules folder over with the package.json and package-lock.json files. This brought over all the needed node types and the only thing that came up was a sql node that was in the flow but never installed via the palette.... there were about 15 other node types it originally needed in the flow and after transfer it never complained about them being missing ... that would be a success.

I yet to try the "npm install" method on the tiny cloud server.

Thanks for everyones guidance on this.

---

<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:** [9 July 2020 21:45 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/10 "2020-07-09T21:45:18Z")

</div>

How much RAM does the server have?

---

<div class="post-metadata">

**Author:** ![mrSidX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrsidx/32/18935_2.png) [@mrSidX](https://discourse.nodered.org/u/mrSidX)\
**Post date:** [16 July 2020 22:35 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/11 "2020-07-16T22:35:07Z")

</div>

I want to say less than 1GB... I think some of the small ones have roughly  
500-600mb.

---

<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:** [17 July 2020 00:39 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/12 "2020-07-17T00:39:23Z")

</div>

That should be enough as long as you are sensible and use a basic, simple OS build. Something like Debian minimal server.

---

<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:** [15 September 2020 00:39 UTC](https://discourse.nodered.org/t/automate-installation-of-missing-node-types/29755/13 "2020-09-15T00:39:44Z")

</div>

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