# Upgrade node-red on windows

**URL:** https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144
**Category:** General
**Created:** [12 June 2023 10:59 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144 "2023-06-12T10:59:25Z")
**Posts on this page:** 13
**Page:** 2

<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: [12 June 2023 16:50 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/21 "2023-06-12T16:50:24Z")

</div>

> [@coat](#):
>
> `npm -g --unsafenpm install -g --unsafe-perm node-red@latest`

that is not correct

Look again

> [@Steve-Mcl](#):
>
> npm install -g --unsafe-perm node-red@latest

---

<div class="post-metadata">

### Author: ![coat](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@coat](https://discourse.nodered.org/u/coat)
#### Post date: [12 June 2023 16:54 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/22 "2023-06-12T16:54:36Z")

</div>

Yes sorry, I see that I was wrong but after that I run the correct command.  
The results is nothing again

....do you think that is better to remove node-red completely and re-install?

---

<div class="post-metadata">

### Author: ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)
#### Post date: [12 June 2023 17:06 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/23 "2023-06-12T17:06:12Z")

</div>

_ **Not sure** _, I think the **npm prefix** is not correct, the following command should return you `C:\Users\Nu!Reha\AppData\Roaming\npm`:

```bash
npm prefix -g

```

If not, it can be set with the command

```bash
npm config set prefix C:\Users\Nu!Reha\AppData\Roaming\npm

```

Then

```bash
npm install -g --unsafe-perm node-red@latest

```

---

<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: [12 June 2023 17:09 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/24 "2023-06-12T17:09:38Z")

</div>

> [@coat](#):
>
> The results is nothing again

Please be specific. Show us exactly what you entered and what you seen.

And show us the startup log.

> [@coat](#):
>
> do you think that is better to remove node-red completely and re-install?

No, but worth a try at this point.

---

<div class="post-metadata">

### Author: ![coat](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@coat](https://discourse.nodered.org/u/coat)
#### Post date: [12 June 2023 17:09 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/25 "2023-06-12T17:09:39Z")

</div>

Great, it works!  
`npm prefix -g` returns `C:\ProgramData\npmglobal` so I set the new path and now node-red is updated!

Thank you so much 😍

---

<div class="post-metadata">

### Author: ![coat](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@coat](https://discourse.nodered.org/u/coat)
#### Post date: [12 June 2023 17:10 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/26 "2023-06-12T17:10:32Z")

</div>

> [@Steve-Mcl](#):
>
> Please be specific. Show us exactly what you entered and what you seen.

The results was exactly the same that with the wrong command.  
With the @GogoVega suggestion now is update

---

<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: [12 June 2023 17:14 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/27 "2023-06-12T17:14:27Z")

</div>

I see you have at some point changed npm global location - you should delete all node\_modules from the old location to avoid this sort of thing in the future..

i.e. if you are now using a machine global path (e.g. `C:\ProgramData\npmglobal`) instead of a user global path (e.g. `C:\Users\Nu!Reha\AppData\Roaming\npm\node_modules`) then get rid of `C:\Users\Nu!Reha\AppData\Roaming\npm\node_modules` completely.

PS: I use a machine path for global modules too (makes more sense)

---

<div class="post-metadata">

### Author: ![coat](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@coat](https://discourse.nodered.org/u/coat)
#### Post date: [13 June 2023 07:13 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/28 "2023-06-13T07:13:07Z")

</div>

> [@Steve-Mcl](#):
>
> I see you have at some point changed npm global location

I honestly don't know. I installed Node-Red a few years ago, can't remember when, and I just follow the official instructions for Windows.

> [@Steve-Mcl](#):
>
> you should delete all node\_modules from the old location to avoid this sort of thing in the future..  
> i.e. if you are now using a machine global path (e.g. `C:\ProgramData\npmglobal`) instead of a user global path (e.g. `C:\Users\Nu!Reha\AppData\Roaming\npm\node_modules`) then get rid of `C:\Users\Nu!Reha\AppData\Roaming\npm\node_modules` completely.

In `environment variable` I have nothing about `npm` in `System variables - Path` (I don't know if this is the right name in english, I'm sorry) but `C:\Program Files\nodejs\`.

Instead, I have `C:\Users\Nu!Reha\AppData\Roaming\npm` in `User variables - path`.

What I have to change avoid this problem in future?

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [13 June 2023 07:34 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/29 "2023-06-13T07:34:10Z")

</div>

@coat  
Sorry; I'm very late to the party.  
Are you aware that there's a [Windows Installer for Node-RED](https://github.com/node-red/windows-installer/releases) available?  
As we're still in (late) beta testing, I'd be very interested how this installer is handling your issue.  
Could you please give it a try and report back the result?

Thank you in advance! Would be highly appreciated!

---

<div class="post-metadata">

### Author: ![coat](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@coat](https://discourse.nodered.org/u/coat)
#### Post date: [13 June 2023 07:46 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/30 "2023-06-13T07:46:23Z")

</div>

Hi @ralphwetzel  
Yes, I can to try it in another machine to avoid to get worse the situation of node-red in my computer 😅 🤣 🙂

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [13 June 2023 08:12 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/31 "2023-06-13T08:12:20Z")

</div>

> [@coat](#):
>
> to get worse the situation of node-red in my computer

😉 You could as well just launch the installer and let it walk through the actions where it tries to analyze your system (without actually doing any installation) - to check if it is able to detect things properly.

---

<div class="post-metadata">

### Author: ![coat](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@coat](https://discourse.nodered.org/u/coat)
#### Post date: [13 June 2023 13:04 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/32 "2023-06-13T13:04:01Z")

</div>

Done.  
It detects the newer version of NodeJs I installed yesterday e suggests to me to keep it.  
Then it detects the newer version of Node-Red (3.0.2) e suggests to me to keep it and that the Global installation was in `C:\Users\Nu!Reha\AppData\Roaming\npm`

Finally....I tried to install 😅  
At the end I start Node-Red and all my flows disappeared.  
I think they are still here.....somewhere 🤣

Anyway I exported all before the installation and everything it's fine

---

<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: [27 June 2023 13:04 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/33 "2023-06-27T13:04:32Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144.md?page=1)
