# Custom nodes deleted on palette install

**URL:** <https://discourse.nodered.org/t/custom-nodes-deleted-on-palette-install/12114>\
**Category:** General\
**Created:** [12 June 2019 12:42 UTC](https://discourse.nodered.org/t/custom-nodes-deleted-on-palette-install/12114 "2019-06-12T12:42:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andydesjardins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andydesjardins/32/8556_2.png) [@Andydesjardins](https://discourse.nodered.org/u/Andydesjardins)\
**Post date:** [12 June 2019 12:42 UTC](https://discourse.nodered.org/t/custom-nodes-deleted-on-palette-install/12114/1 "2019-06-12T12:42:54Z")

</div>

Hello,

We created 3 custom nodes (that are not to be shared on github). They work well in our environment. But each time we install a palette, they get deleted. I have to recover them throught git.

Anyone has any clue how to prevent that? I guess I have to reference them elsewhere.

We are on Windows 10

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [12 June 2019 12:59 UTC](https://discourse.nodered.org/t/custom-nodes-deleted-on-palette-install/12114/2 "2019-06-12T12:59:53Z")

</div>

Hi @Andydesjardins

how exactly have you installed them into node-red? If they are not listed in `~/.node-red/package.json` then npm will remove them when you install another node - one of the 'features' of more recent npm versions.

---

<div class="post-metadata">

**Author:** ![Andydesjardins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andydesjardins/32/8556_2.png) [@Andydesjardins](https://discourse.nodered.org/u/Andydesjardins)\
**Post date:** [12 June 2019 13:55 UTC](https://discourse.nodered.org/t/custom-nodes-deleted-on-palette-install/12114/3 "2019-06-12T13:55:44Z")

</div>

Hello @knolleary,

(Nice job on Node-RED)

We followed the procedure except that we didn't published on npm. The custom nodes are in the package.json under the dependencies section. Any clue?

Thanks

---

<div class="post-metadata">

**Author:** ![Andydesjardins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andydesjardins/32/8556_2.png) [@Andydesjardins](https://discourse.nodered.org/u/Andydesjardins)\
**Post date:** [14 June 2019 17:54 UTC](https://discourse.nodered.org/t/custom-nodes-deleted-on-palette-install/12114/4 "2019-06-14T17:54:37Z")

</div>

Ok I found the way to do it. If someone need the answer:

Don't put custom node directly in the node-red/node\_modules directory. Instead, I placed them in a folder next to node-red folder. In command line, go in the node-red folder, npm install

It creates a junction from the node-red/node\_modules folder to the custom node foder. It also add a path to the custom node folder in the node-red/package.json AND node-red/package-lock.json.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 June 2019 18:22 UTC](https://discourse.nodered.org/t/custom-nodes-deleted-on-palette-install/12114/5 "2019-06-14T18:22:37Z")

</div>

Ah, I didn't realise you had been copying files directly into the node\_modules directory. This is why I asked how exactly you had installed them. Your response said you had followed our instructions... but they do not say to copy files like that.

Glad you figured it out.
