# 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:** 20\
**Page:** 1

<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 10:59 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/1 "2023-06-12T10:59:25Z")

</div>

Hi all!  
I'm trying to upgrade node-red on my windows 10 from 2.2.1 to the newer.  
So, I used the command

```auto
npm install -g --unsafe-perm node-red

```

as read in the guide.

After a few seconds, it returns

```auto
changed 293 packages in 14s

41 packages are looking for funding
   run npm fund for details

```

so I use

```auto
node-red

```

command again but it is still at 2.2.1 version.

I tried to upgrade NodeJs downloading from the website and now I have 20.3.0 version, but it seems that node-red doesn't want to upgrade anyway.

What I'm wrong?

Thank you all!

---

<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 11:07 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/2 "2023-06-12T11:07:37Z")

</div>

Hi, did you run your command

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

```

with version 20 of NodeJS or the previous version?

---

<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 11:18 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/3 "2023-06-12T11:18:27Z")

</div>

Hi @GogoVega  
With both but nothing changed

---

<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 11:27 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/4 "2023-06-12T11:27:10Z")

</div>

Do you read the version of Node-RED from the terminal or from the editor (browser) because you have to refresh the editor. Do you get an error when launching NR?  
Do you have v20.3.0 when you run the command `node -v`?

---

<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 12:42 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/5 "2023-06-12T12:42:44Z")

</div>

I read the number 2.2.1 from terminal and in browser too.  
Yes, if I run the command you said it returns

```auto
v20.3.0

```

I attach what I see when run node-red command

```auto
PS C:\Users\Nu!Reha> node-red
12 Jun 14:41:03 - [info]

Welcome to Node-RED
===================

12 Jun 14:41:03 - [info] Node-RED version: v2.2.1
12 Jun 14:41:03 - [info] Node.js version: v20.3.0
12 Jun 14:41:03 - [info] Windows_NT 10.0.19045 x64 LE
12 Jun 14:41:04 - [info] Loading palette nodes
12 Jun 14:41:05 - [warn] [node-red-contrib-tuya-smart-device] Node module cannot be loaded on this version. Requires: >=2.5.0
12 Jun 14:41:06 - [info] Dashboard version 3.5.0 started at /ui
12 Jun 14:41:06 - [info] Settings file : C:\Users\Nu!Reha\.node-red\settings.js
12 Jun 14:41:06 - [info] Context store : 'default' [module=memory]
12 Jun 14:41:06 - [info] User directory : /home/nol/.node-red/
12 Jun 14:41:06 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Jun 14:41:06 - [info] Flows file : \home\nol\.node-red\flows.json
12 Jun 14:41:06 - [info] Server now running at http://127.0.0.1:1880/
12 Jun 14:41:06 - [warn]

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

12 Jun 14:41:06 - [info] Starting flows
12 Jun 14:41:06 - [info] Started flows
12 Jun 14:41:06 - [info] [alexa-remote-account:e66d9d76ee78d58e] intialising with the PROXY method and saved data...

```

And this is in the editor:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/6/862a6e6a86b7ed5e3f446f632af42401bdc419a1.png)

---

<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 13:18 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/6 "2023-06-12T13:18:42Z")

</div>

Can you run

```bash
npm list -g

```

If the Node-RED version is 3, can you try restarting your computer

---

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

</div>

Running the command it returns:

```auto
PS C:\Users\Nu!Reha> npm list -g
C:\ProgramData\npmglobal
+-- @tuyapi/cli@1.18.3
+-- node-gyp@8.4.1
+-- node-red@3.0.2
`-- npm@9.7.1

```

I tried to restart my computer but nothing changed.  
When I run

```auto
node-red

```

command it says that I'm still at v2.2.1

---

<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 13:36 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/8 "2023-06-12T13:36:00Z")

</div>

> [@coat](#):
>
> `C:\Users\Nu!Reha\.node-red\settings.js`

can you delete this settings file (so that a new v3 format settings file is auto generated).

- Stop node red
- delete `C:\Users\Nu!Reha\.node-red\settings.js` (or rename it / move it)
- start node-red
- show us the output of the startup log

Laslty, what does `where node-red` reveal?

---

<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 13:42 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/9 "2023-06-12T13:42:17Z")

</div>

Hi @Steve-Mcl  
I have done what you said and this is the startup log

```auto
PS C:\Users\Nu!Reha> node-red
12 Jun 15:39:40 - [info]

Welcome to Node-RED
===================

12 Jun 15:39:40 - [info] Node-RED version: v2.2.1
12 Jun 15:39:40 - [info] Node.js version: v20.3.0
12 Jun 15:39:40 - [info] Windows_NT 10.0.19045 x64 LE
12 Jun 15:39:40 - [info] Loading palette nodes
12 Jun 15:39:41 - [info] Settings file : C:\Users\Nu!Reha\.node-red\settings.js
12 Jun 15:39:41 - [info] Context store : 'default' [module=memory]
12 Jun 15:39:41 - [info] User directory : \Users\Nu!Reha\.node-red
12 Jun 15:39:41 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Jun 15:39:41 - [info] Flows file : \Users\Nu!Reha\.node-red\flows.json
12 Jun 15:39:41 - [info] Creating new flow file
12 Jun 15:39:41 - [warn]

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

12 Jun 15:39:41 - [info] Server now running at http://127.0.0.1:1880/
12 Jun 15:39:41 - [info] Starting flows
12 Jun 15:39:41 - [info] Started flows

```

Now I have not my flows no more, there is nothing 😅

Then if I use the command

```auto
where node-red

```

I obtain nothing

```auto
PS C:\Users\Nu!Reha> where node-red
PS C:\Users\Nu!Reha>

```

---

<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 13:47 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/10 "2023-06-12T13:47:56Z")

</div>

> [@coat](#):
>
> Now I have not my flows no more, there is nothing

because you had some copy paste code in your original settings

> [@coat](#):
>
> `Flows file : \home\nol\.node-red\flows.json`

> [@coat](#):
>
> `User directory : /home/nol/.node-red/`

Your flows are in `c:\home\nol\.node-red`

> [@coat](#):
>
> I obtain nothing
> 
> ```auto
> PS C:\Users\Nu!Reha> where node-red
> PS C:\Users\Nu!Reha>
> 
> ```

Can you do that in a `cmd` window.

Also, please show me the content of `c:\home\nol\.node-red` (top level only)

---

<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 13:54 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/11 "2023-06-12T13:54:48Z")

</div>

> [@Steve-Mcl](#):
>
> because you had some copy paste code in your original settings
> 
> > [@coat](#):
> >
> > `Flows file : \home\nol\.node-red\flows.json`
> 
> > [@coat](#):
> >
> > `User directory : /home/nol/.node-red/`
> 
> Your flows are in `c:\home\nol\.node-red`

Ok, they're safe 🤣 thanks!

Using `where node-red` in `cmd` it returns

```auto
C:\Users\Nu!Reha\AppData\Roaming\npm\node-red
C:\Users\Nu!Reha\AppData\Roaming\npm\node-red.cmd

```

This is what I have in `c:\home\nol\.node-red`

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/a/da5ca672862924f480e7b08c27239b4671904b2a.png)

---

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

</div>

~~I guess now you need to modify the shortcut (`C:\Users\Nu!Reha\AppData\Roaming\npm\node-red`) to point to `C:\Users\Nu!Reha\.node-red\red.js`.~~  
For existing files/folders in this folder you can move them to `C:\Users\Nu!Reha\.node-red` but first let's ask @Steve-Mcl if it's correct

EDIT: I don't know where the Node-RED binary file is located on Windows 🤔

---

<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 14:08 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/13 "2023-06-12T14:08:53Z")

</div>

> [@GogoVega](#):
>
> I guess now you need to modify the shortcut (`C:\Users\Nu!Reha\AppData\Roaming\npm\node-red`) to point to `C:\Users\Nu!Reha\.node-red\red.js`.

How can I do this?  
Anyway, I have not any `red.js` file in `C:\Users\Nu!Reha\.node-red`

---

<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 15:30 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/14 "2023-06-12T15:30:21Z")

</div>

Ok so the Node-RED module is stored at `C:\Users\Nu!Reha\AppData\Roaming\npm\node_modules\node-red`.  
This folder also contains a settings file: is `userDir` commented?  
The `package.json` should show 3.0.2 as the version

---

<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 15:39 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/15 "2023-06-12T15:39:54Z")

</div>

Yes, `userDir` is commented.  
The `package.json` in `C:\Users\Nu!Reha\AppData\Roaming\npm\node_modules\node-red` show this:

```auto
"name": "node-red",
    "version": "2.2.1",
    "description": "Low-code programming for event-driven applications",
    "homepage": "http://nodered.org",
    "license": "Apache-2.0",

```

(these are the 5 first lines)

---

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

</div>

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

:doh: I missed that!

Due to semantic versioning, you are simply re-installing the same version of node-red

Do the upgrade once more, but specify latest (or next if you want the cutting edge stuff)

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

or

`npm install -g --unsafe-perm node-red@next`

---

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

</div>

> [@Steve-Mcl](#):
>
> Due to semantic versioning, you are simply re-installing the same version of node-red

😱 one more thing learned 😍 thanks 😘

---

<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:35 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/18 "2023-06-12T16:35:19Z")

</div>

Nothing. 🥲 😒  
I tried both commands in `cmd` and in `Powershell` too but nothing happens.  
Just this

```auto
PS C:\Users\Nu!Reha> npm -g --unsafenpm install -g --unsafe-perm node-red@latest

added 6 packages, removed 12 packages, and changed 287 packages in 8s

41 packages are looking for funding
  run `npm fund` for details

```

And

```auto
PS C:\Users\Nu!Reha> npm -g --unsafenpm install -g --unsafe-perm node-red@next

added 12 packages, removed 6 packages, and changed 287 packages in 19s

42 packages are looking for funding
  run `npm fund` for details

```

but when i run `node-red` it returns

```auto
PS C:\Users\Nu!Reha> node-red
12 Jun 18:33:36 - [info]

Welcome to Node-RED
===================

12 Jun 18:33:36 - [info] Node-RED version: v2.2.1
12 Jun 18:33:36 - [info] Node.js version: v20.3.0
12 Jun 18:33:36 - [info] Windows_NT 10.0.19045 x64 LE
12 Jun 18:33:38 - [info] Loading palette nodes

```

etc.

---

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

</div>

Can you run

```bash
npm root -g

```

`next` is "beta" version and `latest` is "stable" version

---

<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:47 UTC](https://discourse.nodered.org/t/upgrade-node-red-on-windows/79144/20 "2023-06-12T16:47:48Z")

</div>

```auto
PS C:\Users\Nu!Reha> npm root -g
C:\ProgramData\npmglobal\node_modules

```

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