# Multiple instances of nodejs and nodered

**URL:** <https://discourse.nodered.org/t/multiple-instances-of-nodejs-and-nodered/40221>\
**Category:** General\
**Created:** [2 February 2021 09:06 UTC](https://discourse.nodered.org/t/multiple-instances-of-nodejs-and-nodered/40221 "2021-02-02T09:06:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nxito](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nxito/32/88293_2.png) [@Nxito](https://discourse.nodered.org/u/Nxito)\
**Post date:** [2 February 2021 09:06 UTC](https://discourse.nodered.org/t/multiple-instances-of-nodejs-and-nodered/40221/1 "2021-02-02T09:06:05Z")

</div>

hi, i describe my problem

I use windows and I have multiple instances of node-red, all of them with their respective NSSM service.

All are version 1.0.6 and my nodejs is v10.15.3

**Now I have to create a new node-red instance**

nodejs version 10 will be without maintenance in April, so i think i will need to update on this machine to v12

I've been searching the forum and google and found **NVM** ,  
is this a solution to my problem?  
Does this have any drawbacks?  
Is it possible that my version 1.0.6 nodes get corrupted if I update nodejs directly?  
what do you think about this?

---

<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:** [2 February 2021 09:11 UTC](https://discourse.nodered.org/t/multiple-instances-of-nodejs-and-nodered/40221/2 "2021-02-02T09:11:30Z")

</div>

> [@Nxito](#):
>
> so i think i will need to update on this machine to v12

I would skip 12 and move to V14.

> [@Nxito](#):
>
> I've been searching the forum and google and found **NVM** ,  
> is this a solution to my problem?  
> Does this have any drawbacks?

Yes, it can be problematic - search the forum for NVM

> [@Nxito](#):
>
> Is it possible that my version 1.0.6 nodes get corrupted if I update nodejs directly?

No but if there are nodes that are "built" (e.g. serial port) you will need to do `npm rebuild` - covered many times on the forum - search `npm rebuild`

* * *

PS. backup your flows before starting - not 100% necessary (as they should be un-touched) but provides piece of mind that you can get back to where your started if you mess up.

---

<div class="post-metadata">

**Author:** ![Nxito](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nxito/32/88293_2.png) [@Nxito](https://discourse.nodered.org/u/Nxito)\
**Post date:** [2 February 2021 09:31 UTC](https://discourse.nodered.org/t/multiple-instances-of-nodejs-and-nodered/40221/3 "2021-02-02T09:31:22Z")

</div>

thanks for answering

I will do tests on my local machine for safety and so not to break what I have mounted

I'll wait to see what others think before giving your answer as a solution

---

<div class="post-metadata">

**Author:** ![Nxito](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nxito/32/88293_2.png) [@Nxito](https://discourse.nodered.org/u/Nxito)\
**Post date:** [2 February 2021 09:39 UTC](https://discourse.nodered.org/t/multiple-instances-of-nodejs-and-nodered/40221/4 "2021-02-02T09:39:57Z")

</div>

> [@Steve-Mcl](#):
>
> No but if there are nodes that are "built" (e.g. serial port) you will need to do `npm rebuild` - covered many times on the forum - search `npm rebuild`

With `nodes that are "built"` what do you mean?  
For example, I use the OPC UA and mmsql-plus nodes, would anyone be affected at update nodejs?

---

<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:** [2 February 2021 10:13 UTC](https://discourse.nodered.org/t/multiple-instances-of-nodejs-and-nodered/40221/5 "2021-02-02T10:13:02Z")

</div>

> [@Nxito](#):
>
> With `nodes that are "built"` what do you mean?

some NPM modules are "built" (c++ bindings) when installed. They are build based on the nodejs version. So if you upgrade, the bindings will not match & so need to be rebuilt. TBH, its just easier (cleaner) to pretty much start again.

install nodejs  
delete node\_modules folder  
npm install

As for mssql-plus - there is no build step for that node. OPCUA - unsure (I avoid OPCAU as much as possible 🙂 )

---

<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:** [2 February 2021 10:54 UTC](https://discourse.nodered.org/t/multiple-instances-of-nodejs-and-nodered/40221/6 "2021-02-02T10:54:13Z")

</div>

I think node-red will need to be rebuilt won't it? If so then it will need to be done for all instances whether there are other built nodes or not.

---

<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:** [16 February 2021 10:55 UTC](https://discourse.nodered.org/t/multiple-instances-of-nodejs-and-nodered/40221/7 "2021-02-16T10:55:07Z")

</div>

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