# Help upgrading Node

**URL:** <https://discourse.nodered.org/t/help-upgrading-node/57965>\
**Category:** General\
**Created:** [8 February 2022 02:25 UTC](https://discourse.nodered.org/t/help-upgrading-node/57965 "2022-02-08T02:25:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![quarfie](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/quarfie/32/39697_2.png) [@quarfie](https://discourse.nodered.org/u/quarfie)\
**Post date:** [8 February 2022 02:25 UTC](https://discourse.nodered.org/t/help-upgrading-node/57965/1 "2022-02-08T02:25:44Z")

</div>

A few days ago I upgraded Node-RED to 2.2.0 with

```auto
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

```

But Node.js was still at 12.22.10, and I want to install a Node that requires Node.js 16, so I tried running the commands on the Node.js homepage:

```auto
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
nvm install --lts

```

And now `node -v` returns 16.13.2, but Node-RED is still running under 12.22.10 even after reboot.  
I tried running the above `bash <(curl...` again but it didn't solve, and I also noticed it said something about how using nvm was not recommended.

What should I do next?

I am running Ubuntu 20.04

Thank you!

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [8 February 2022 02:47 UTC](https://discourse.nodered.org/t/help-upgrading-node/57965/2 "2022-02-08T02:47:53Z")

</div>

Hello ..

you are right .. its not recommended to install Nodejs using nvm  
you should try to uninstall it ..  
and just let the bash script install the version of Nodejs  
by just adding to the end of the command `--node16`

`bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node16`

---

<div class="post-metadata">

**Author:** ![quarfie](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/quarfie/32/39697_2.png) [@quarfie](https://discourse.nodered.org/u/quarfie)\
**Post date:** [8 February 2022 03:29 UTC](https://discourse.nodered.org/t/help-upgrading-node/57965/3 "2022-02-08T03:29:27Z")

</div>

Here's what I tried...

```auto
nvm use system
//Now using system version of node: v12.22.10 (npm v6.14.16)
nvm uninstall 16.13.2
//Uninstalled node v16.13.2
nvm unload
sudo nano .bashrc

```

Removed these 3 lines:

```auto
export NVM_DIR="$HOME/.nvm"
[-s "$NVM_DIR/nvm.sh"] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[-s "$NVM_DIR/bash_completion"] && \. "$NVM_DIR/bash_completion" # This loads nvm

```

reboot

```auto
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node16

```

I got the NVM warning again, and after install, I could not use node-red-start. I had to use `./node-red` and when I exit, Node-RED shuts down. And it's still using 12.22.10!

So I guess I didn't completely do away with NVM...

If it's too complicated to fix at this point, I could go back to an earlier snapshot...

---

<div class="post-metadata">

**Author:** ![quarfie](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/quarfie/32/39697_2.png) [@quarfie](https://discourse.nodered.org/u/quarfie)\
**Post date:** [8 February 2022 03:38 UTC](https://discourse.nodered.org/t/help-upgrading-node/57965/4 "2022-02-08T03:38:23Z")

</div>

Ok I removed the ~/.nvm folder, rebooted, then ran the `bash <(curl...` script again.

Looks like I'm back in business!!

---

<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:** [8 February 2022 16:08 UTC](https://discourse.nodered.org/t/help-upgrading-node/57965/5 "2022-02-08T16:08:16Z")

</div>

With NVM and similar tools, I think that each node version gets its own environment. That means that if you change node versions in nvm, you need to reinstall node-red for that version.

Similar concept to Python virtual environments - except that with Python, you can also get versions of Python from different vendors - massively confusing!

---

<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:** [22 February 2022 16:08 UTC](https://discourse.nodered.org/t/help-upgrading-node/57965/6 "2022-02-22T16:08:59Z")

</div>

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