# Cannot upgrade to 1.0.2 from 0.20.5

**URL:** https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272
**Category:** General
**Created:** [29 October 2019 10:48 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272 "2019-10-29T10:48:55Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![stamer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stamer/32/3464_2.png) [@stamer](https://discourse.nodered.org/u/stamer)
#### Post date: [29 October 2019 10:48 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/1 "2019-10-29T10:48:56Z")

</div>

Hey,  
I am on Windows 10 and tried to upgrade Node-RED. First, I have upgraded NodeJS (v12.13.0), NPM (6.12.0) and then executed npm install -g --unsafe-perm node-red

The message:  
C:\Users\xxxx\AppData\Roaming\npm\node-red -\> C:\Users\xxxx\AppData\Roaming\npm\node\_modules\node-red\red.js  
C:\Users\xxxx\AppData\Roaming\npm\node-red-pi -\> C:\Users\xxxx\AppData\Roaming\npm\node\_modules\node-red\bin\node-red-pi

- node-red@1.0.2  
updated 1 package in 11.064s  
was displayed.  
If I run node-red, the old version is still there:  
Welcome to Node-RED  
===================

29 Oct 11:08:19 - [info] Node-RED version: v0.20.5  
29 Oct 11:08:19 - [info] Node.js version: v12.13.0  
29 Oct 11:08:19 - [info] Windows\_NT 10.0.18362 x64 LE  
29 Oct 11:08:20 - [info] Loading palette nodes  
29 Oct 11:08:20 - [warn] rpi-gpio : Raspberry Pi specific node set inactive  
29 Oct 11:08:20 - [info] Dashboard version 2.17.1 started at /ui

Please, help!!  
Many thanks.

---

<div class="post-metadata">

### Author: ![stamer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stamer/32/3464_2.png) [@stamer](https://discourse.nodered.org/u/stamer)
#### Post date: [29 October 2019 10:51 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/2 "2019-10-29T10:51:12Z")

</div>

Sorry for the bad formatted text. ☹

---

<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: [29 October 2019 10:53 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/3 "2019-10-29T10:53:12Z")

</div>

You have to check your path environment to see which `node-red` executable it is picking up and then see why it isn't picking up wherever the upgraded node-red has been put.

---

<div class="post-metadata">

### Author: ![stamer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stamer/32/3464_2.png) [@stamer](https://discourse.nodered.org/u/stamer)
#### Post date: [29 October 2019 11:06 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/4 "2019-10-29T11:06:42Z")

</div>

Hey Nick,  
thank for the quick reply.  
I can find the path for the NodeJS, but not for `node-red`. ☹

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [29 October 2019 11:26 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/5 "2019-10-29T11:26:51Z")

</div>

How do you launch node-red?

e.g on my setup I launch a cmd terminal, cd .node-red (so I'm in c:\users\simon\.node-red) and then I type node-red

---

<div class="post-metadata">

### Author: ![stamer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stamer/32/3464_2.png) [@stamer](https://discourse.nodered.org/u/stamer)
#### Post date: [29 October 2019 11:37 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/6 "2019-10-29T11:37:41Z")

</div>

Hey,  
thank you for the great support! 🙂  
I launch `node-red` from c:\users\stamer\.node-red and then I type node-red.

---

<div class="post-metadata">

### Author: ![stamer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stamer/32/3464_2.png) [@stamer](https://discourse.nodered.org/u/stamer)
#### Post date: [29 October 2019 12:53 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/7 "2019-10-29T12:53:29Z")

</div>

Please, can you write your `node-red` path? You are on Windows... 🙂

---

<div class="post-metadata">

### Author: ![stamer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stamer/32/3464_2.png) [@stamer](https://discourse.nodered.org/u/stamer)
#### Post date: [29 October 2019 13:42 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/8 "2019-10-29T13:42:34Z")

</div>

After `node-red` upgrade from 0.20.5 to 1.0.2 (on Windows 10) I have 2 versions of node-red:

1. v0.20.5 -\> C:\Program Files\nodejs\node\_modules\node-red
2. v1.0.2 -\> C:\Users\stamer\AppData\Roaming\npm\node\_modules\node-red  
If I launch `node-red` (I'm in c:\users\stamer.node-red) it will run the old version. ☹  
What is the correct path for `node-red`?  
Please help!  
Many thanks.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [29 October 2019 14:39 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/9 "2019-10-29T14:39:52Z")

</div>

> [@stamer](#):
>
> Please, can you write your `node-red` path?

I don't know how to do that ☹

---

<div class="post-metadata">

### Author: ![stamer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stamer/32/3464_2.png) [@stamer](https://discourse.nodered.org/u/stamer)
#### Post date: [29 October 2019 15:13 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/10 "2019-10-29T15:13:48Z")

</div>

Thanks for your answer.  
I use at the moment `node-red` v.0.20.5.  
v1.0.2 includes some changes, especially regarding the new signature for the `input` event callback function. I wanted to update my custom nodes to this new callback signature...  
Maybe someone else can tell me the `node-red` path...

---

<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: [29 October 2019 15:29 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/11 "2019-10-29T15:29:07Z")

</div>

To find the actual command on Windows, it is similar to the way you do it on Linux. The only thing is that you need to use PowerShell and not a cmd prompt.

```auto
which node-red

```

---

<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: [29 October 2019 15:51 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/12 "2019-10-29T15:51:06Z")

</div>

Unfortunately, I never install Node-RED globally. However, I have another package installed globally and `which` tells me:

```auto
> which alternate-node-red-installer C:\Users\julia\AppData\Roaming\npm\alternate-node-red-installer.cmd

```

---

<div class="post-metadata">

### Author: ![stamer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stamer/32/3464_2.png) [@stamer](https://discourse.nodered.org/u/stamer)
#### Post date: [29 October 2019 16:30 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/13 "2019-10-29T16:30:57Z")

</div>

Hey Julian,  
thanks for reply.  
If I use PowerShell, I got the same path as the cmd prompt: /cygdrive/c/Program Files/nodejs/node-red.  
I expected this, because the old version will be launch from there.  
But I'm surprised to see, that **only the path of the current version v1.0.2** is in my path environment and nevertheless the old version will be launch...

---

<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: [29 October 2019 16:47 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/14 "2019-10-29T16:47:09Z")

</div>

Ah, well now I understand the issue 🕶

The path shows me that you are using cygwin rather than native Windows - the reason you have 2 installations is because you've installed it twice I suspect, each time a different way.

Node-RED and node.js works very well, of course, natively in Windows and there is no need for cygwin. If you really want a Linux-like environment in Windows, I would suggest using the Windows Subsystem for Linux (WSL) which is much better integrated than the rather long in the tooth cygwin.

Incidentally, if you find yourself needing more complex development scenarios with Node-RED, I suggest installing it locally rather than globally which can help avoid all of these issues. I wrote the alternate installer listed previously to help with that. You can find it in my GitHub.

---

<div class="post-metadata">

### Author: ![stamer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stamer/32/3464_2.png) [@stamer](https://discourse.nodered.org/u/stamer)
#### Post date: [29 October 2019 17:31 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/15 "2019-10-29T17:31:32Z")

</div>

Thank you Julian. 🙂  
You comes from IT sector. 😉  
Please, can you tell me, if it is a best practice to remove the directory where the old version of `node-red` resides and to install the new one to that path?  
Many thanks.

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [29 October 2019 22:23 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/16 "2019-10-29T22:23:43Z")

</div>

@stamer

I think what Julian is trying to say is that you have installed two different TYPES of Node-red - one of them is a Native Windows installation executable and the other appears to be the linux one, which you have kludged by using Cygwin - so first question - is there a reason for this or have you just been "stumbling around",

What is your preferred operating environment - if it is Windows then remove cygwin and NR from there and do a native windows install to upgrade your current version

If you want to operate in a linux environment then either install and setup WSL (As Julian has said above) or spin up a Linux Virtual machine under Hyper V (free with Windows 10) and install NR in there

Craig

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [29 October 2019 22:47 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/17 "2019-10-29T22:47:41Z")

</div>

Try running .node-red.cmd and see if that runs the 1.0.2 version

---

<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: [30 October 2019 00:46 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/18 "2019-10-30T00:46:48Z")

</div>

> [@stamer](#):
>
> You comes from IT sector

Well, I've been at it since about 1978 so I should have picked up a thing or two by now I guess! 🥴

> [@stamer](#):
>
> if it is a best practice to remove the directory where the old version of `node-red` resides and to install the new one to that path?

Well, as Craig says, unless you have a good reason to keep another version, personally I would get rid of it since it will get stale and probably cause you future confusion.

The reason I always install locally is so that I'm always in control of where things are and I can always see where things are since everything is contained by a single parent folder. I always then create my userDir as a subfolder and everything stays together. Easy to remember, easy to manage, easy to back up or move.

In regard to cygwin, I think that most people end up with it because of Git. Traditionally, git needed a number of Linux type command line tools to work properly and the easiest way for them to do that on Windows was with cygwin.

So you probably just need to make sure that you are NOT using the git shell but instead either use the Windows cmd.exe shell or PowerShell. Then you can install npm packages in a consistent way. If you've installed git from the official Windows installation, it should work just fine under Windows' shells.

`which node-red` tells you which version your current shell is trying to use. `npm -g remove node-red` gets rid of it.

---

<div class="post-metadata">

### Author: ![stamer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stamer/32/3464_2.png) [@stamer](https://discourse.nodered.org/u/stamer)
#### Post date: [30 October 2019 12:22 UTC](https://discourse.nodered.org/t/cannot-upgrade-to-1-0-2-from-0-20-5/17272/19 "2019-10-30T12:22:26Z")

</div>

**Thank you very much for your great support!** 🙂

I used Cygwin a long time ago, my system is old...  
@craigcurtin There was no reason to install `node-red` there.  
@cymplecy .node-red.cmd does not work.  
I will remove Cygwin, then `node-red` and then I will reinstall `node-red` to have only the latest version.  
@TotallyInformation I will try the alternate-node-red-installer. 😉
