# Is it possible to add node-red modules as .deb file dependencies so a user will not need an internet connection when installing?

**URL:** <https://discourse.nodered.org/t/is-it-possible-to-add-node-red-modules-as-deb-file-dependencies-so-a-user-will-not-need-an-internet-connection-when-installing/9405>\
**Category:** General\
**Created:** [25 March 2019 15:46 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-node-red-modules-as-deb-file-dependencies-so-a-user-will-not-need-an-internet-connection-when-installing/9405 "2019-03-25T15:46:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rando](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@rando](https://discourse.nodered.org/u/rando)\
**Post date:** [25 March 2019 15:46 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-node-red-modules-as-deb-file-dependencies-so-a-user-will-not-need-an-internet-connection-when-installing/9405/1 "2019-03-25T15:46:53Z")

</div>

I've created a Debian .deb package that populates my project onto a user's machine. I run "npm install" commands for my dependencies in the postinst script, but this requires the user to have an internet connection, which will not always be the case. I was wondering if there is a best practice where I can include the npm modues as dependencies that are included within the .deb file?

Thanks!

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [25 March 2019 15:54 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-node-red-modules-as-deb-file-dependencies-so-a-user-will-not-need-an-internet-connection-when-installing/9405/2 "2019-03-25T15:54:23Z")

</div>

There was a thread about something similar in the past couple weeks. Did you read that?

---

<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:** [25 March 2019 20:55 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-node-red-modules-as-deb-file-dependencies-so-a-user-will-not-need-an-internet-connection-when-installing/9405/3 "2019-03-25T20:55:14Z")

</div>

Yes, it is possible. Node-RED is a node.js application and they are relatively straight-forwards to package into a redistributable archive.

The only tricky part would be if you had to handle more than one platform since some nodes require compiling. Not a problem if you are always on the same platform since the compiled code will work just fine.

---

<div class="post-metadata">

**Author:** ![rando](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@rando](https://discourse.nodered.org/u/rando)\
**Post date:** [28 March 2019 13:34 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-node-red-modules-as-deb-file-dependencies-so-a-user-will-not-need-an-internet-connection-when-installing/9405/4 "2019-03-28T13:34:14Z")

</div>

Thanks for the response, TI. When building my .deb package, there is a "control" file that contains a "Depends" and "Recommends" section, and if I add the names of debian software packages here they will be added to my .deb file. Is adding npm modules a similar process? Do you know of any good tutorials describing this process? I've searched endlessly and have come up short.

Thanks again!

---

<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:** [28 March 2019 13:45 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-node-red-modules-as-deb-file-dependencies-so-a-user-will-not-need-an-internet-connection-when-installing/9405/5 "2019-03-28T13:45:38Z")

</div>

I think that you are over complicating it.

There is no real link between a deb package and an npm package. You need to look at how Node.JS devs package up code for offline installation. Not an area that I am expert in.

The brute force method would be to install everything somewhere that has the same platform type and then take an archive of it, in your deb you should be able to unpack the archive on installation I think?

I'm sure there are probably better ways though.

---

<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:** [28 March 2019 22:48 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-node-red-modules-as-deb-file-dependencies-so-a-user-will-not-need-an-internet-connection-when-installing/9405/6 "2019-03-28T22:48:17Z")

</div>

Indeed that is the way we do it for the Pi build... do a clean install, remove a load of crud (like test and benchmark code), add the control files and, then pack it all back up as a deb. Ugly but it works.

---

<div class="post-metadata">

**Author:** ![nlecaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nlecaude/32/25_2.png) [@nlecaude](https://discourse.nodered.org/u/nlecaude)\
**Post date:** [29 March 2019 01:11 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-node-red-modules-as-deb-file-dependencies-so-a-user-will-not-need-an-internet-connection-when-installing/9405/7 "2019-03-29T01:11:57Z")

</div>

Perhaps look at [https://www.npmjs.com/package/node-deb](https://www.npmjs.com/package/node-deb)  
We've used it successfully in the past. The idea is to npm install before building and including the node\_modules folder in your build.
