# UIBuilder, install default packages when creating a node-red projects

**URL:** https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496
**Category:** General
**Tags:** docker, uibuilder
**Created:** [4 June 2024 09:59 UTC](https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496 "2024-06-04T09:59:34Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Elronde](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/elronde/32/91689_2.png) [@Elronde](https://discourse.nodered.org/u/Elronde)
#### Post date: [4 June 2024 09:59 UTC](https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496/1 "2024-06-04T09:59:34Z")

</div>

Hello,

I'm currently upgrading UIBuilder on my project from version 3 to 6.

There is a breaking change in version 5.0 that remove the files packageList.json and masterPackageList.json.  
It was pretty useful because when creating a project, a list of default npm module was installed in the project.

To explain how I use it. When building the docker image, I also install a list of module. So when the creating a new node-red project those package where available by default.

Is there a way to keep this behavior with UIBuilder 6.0 ?

Thanks in advance

---

<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: [4 June 2024 10:08 UTC](https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496/2 "2024-06-04T10:08:42Z")

</div>

Hi Elronde, thanks for raising this and sorry for causing you an issue.

The packageList was actually integrated into UIBUILDER's package.json. I appreciate though that this might not have quite the same features.

So if you are including UIBUILDER in a Docker image, you can simply add your required modules to UIBUILDER's package.json file. However, if you do that without pre-installing the modules into the Docker image, you would need to run an `npm install` script from the uibRoot folder at some point before running.

---

<div class="post-metadata">

### Author: ![Elronde](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/elronde/32/91689_2.png) [@Elronde](https://discourse.nodered.org/u/Elronde)
#### Post date: [4 June 2024 12:24 UTC](https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496/3 "2024-06-04T12:24:07Z")

</div>

Thank for your answer. I do have the module installed when node-red isn't in project mode. But when creating a project. The uibuilder package.json (which contains the modules) isn't copied inside the /\<project\_name\>/uibuilder/package.json

Do I miss something ?

---

<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: [4 June 2024 18:44 UTC](https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496/4 "2024-06-04T18:44:16Z")

</div>

Ah, I don't use projects, had a few too many issues with them. I guess uibuilder creates a new blank package.json for a new project?

Perhaps I need to re-introduce a method that would force a set of modules into the package.json when it is created? Nobody has commented on this previously I'm afraid. But I am certainly open to suggestions and there is a bit of time before v7 gets released so I expect something could be squeezed in. 🙂

---

<div class="post-metadata">

### Author: ![Elronde](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/elronde/32/91689_2.png) [@Elronde](https://discourse.nodered.org/u/Elronde)
#### Post date: [4 June 2024 19:11 UTC](https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496/5 "2024-06-04T19:11:21Z")

</div>

Yes, it creates a blank package.json.

Reintroducing this mechanism would be really great and practical. Every project could have a default set of modules.

If you agree to introduce it for 7.0 that would be really great 🙂

---

<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: [4 June 2024 19:38 UTC](https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496/6 "2024-06-04T19:38:18Z")

</div>

> [@Elronde](#):
>
> If you agree to introduce it for 7.0 that would be really great

Your wish is my command. 🙂

Added to the to-do list for v7

Initial thinking is that there will be a new but optional file in the `<uibRoot>/.config/` folder, called something like `projectPackage.json`. It would be, I think a ~~sub-set of a standard package.json~~ A full package.json on 2nd thoughts so that it would be easy to copy/paste your current `<uibRoot>/package.json`. That will let you include a default version, description, etc if you wish along-side the dependencies.

I will attempt to also trap a new project create to run the install if I can. Otherwise, it will display a notification for the user to run that manually. Not certain whether Node-RED will have to be restarted, I will try to avoid that but it might not be possible. Will have to test.

---

<div class="post-metadata">

### Author: ![Elronde](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/elronde/32/91689_2.png) [@Elronde](https://discourse.nodered.org/u/Elronde)
#### Post date: [6 June 2024 08:58 UTC](https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496/7 "2024-06-06T08:58:28Z")

</div>

So nice ! Thanks you ! 🙂

Yes, I think that you're right about the full package.json instead of a projectPackage.json

---

<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: [4 September 2024 08:59 UTC](https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496/8 "2024-09-04T08:59:02Z")

</div>

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