# "npm does not support Node.js v10.19.0" - Ubuntu

**URL:** <https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350>\
**Category:** General\
**Created:** [15 February 2022 01:35 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350 "2022-02-15T01:35:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [15 February 2022 01:35 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350/1 "2022-02-15T01:35:22Z")

</div>

Hi,

Appear to have iteratively broken my Node-RED installation, can someone give me a hand getting back on track?

- First I tried to update node-red-contrib-virtual-smart-home via palette manager, but received an error about needing to upgrade npm as the version wasn't supported

- so on my Ubuntu server, I ran sudo npm upgrade, it told me to then run nmp install -g npm, so I did that too then restarted Node-RED

- now Node-RED doesn't show Palette Manager in the menu

- I have tried to reinstall npm as follows: sudo npm install npm@latest -g  
... however I get

npm does not support Node.js v10.19.0  
You should probably upgrade to a newer version of node as we  
can't make any promises that npm will work with this version.

- so then I followed online instructions for upgrading Node.js, and I ran `sudo apt update`, then `npm cache clean -f` (again error that npm does not support Node.js v10.19.0), then `npm install -g n`  
then `sudo n stable`, all of which gave me the same error as above, although the latter just gave "sudo: n: command not found"

What am I doing wrong? TIA!

---

<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:** [15 February 2022 01:54 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350/2 "2022-02-15T01:54:51Z")

</div>

For starters, do you really need `n`? Node.js version managers really mess you up unless you really know what you are doing.

While this approach might not suit everyone, my personal view is that you should take direct charge of your installations.

In your case, that probably means removing n and node.js and any Ubuntu installation of npm.

Then go to the node.js site and find the instructions for installing via a package manager. Add the library for node.js v16 or v14 if you want to be conservative. Then install. That should give you both node.js and npm of matching versions.

Since you were using n, you may need to reinstall node-red as well. In fact, it doesn't hurt anyway. After that, if any nodes are messed up, you can reinstall those as well. In fact, the easiest way to ensure everything is right is to delete your `~/.node-red/node_modules/` folder and then in ~/.node-red, just run `npm install` since the package.json file in that folder should still have all of the dependencies listed.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [15 February 2022 01:57 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350/3 "2022-02-15T01:57:05Z")

</div>

I'm really sorry - is "n" the same as npm? It's the kind of thing that's difficult to google...

---

<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:** [15 February 2022 01:57 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350/4 "2022-02-15T01:57:50Z")

</div>

haha, no, `n` is a node.js version manager. Like nvm.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [15 February 2022 01:59 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350/5 "2022-02-15T01:59:33Z")

</div>

Ahh okay. You said " delete your `~/.node-red/node_modules/` folder and then in ~/.node-red, just run `npm install`"

Is that instead of the things you suggested before that point?

Given what you have said, sounds like it may be quicker to reinstall a new virtual machine and start with a clean Ubuntu from scratch... all from trying to update one contrib ☹

To be clear, I don't think I had actually installed n - I always preferred to install each package myself in the OS rather than using version managers etc.... I was following instructions from some online tutorial. The command failed anyway...

---

<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:** [15 February 2022 02:15 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350/6 "2022-02-15T02:15:08Z")

</div>

> [@hazymat](#):
>
> Is that instead of the things you suggested before that point?

No, that is after the other things.

> [@hazymat](#):
>
> all from trying to update one contrib

Well, that shouldn't happen of course. And it doesn't. First rule rule when IT things go wrong is not to panic. Node.js application installations are logical. If there is a "fault" with Node-RED, it is that people don't learn the basics because for the most part Node-RED just works. But then if something odd does happen, you don't have the basics to fall back on that lets you understand what happened and how to recover.

> [@hazymat](#):
>
> To be clear, I don't think I had actually installed n - I always preferred to install each package myself in the OS rather than using version managers etc

OK, that should help. But the issue with Linux is that the versions of libraries and apps that are packaged in the default repositories aren't always the best or latest. Personally I prefer to use the repositories provided by a project if they are available.

For node.js, see [Installing Node.js via package manager | Node.js (nodejs.org)](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions). It tells you the packages for Debian and Ubuntu based installations are at [distributions/README.md at master · nodesource/distributions (github.com)](https://github.com/nodesource/distributions/blob/master/README.md).

> [@hazymat](#):
>
> I was following instructions from some online tutorial. The command failed anyway...

Ah, the Facebook problem 😀 I generally look at least at a few to see if there is consensus or different options.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [15 February 2022 02:20 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350/7 "2022-02-15T02:20:39Z")

</div>

> [@TotallyInformation](#):
>
> I generally look at least at a few to see if there is consensus or different options.

Oh I did that... but was slightly impatient if honest. I'm a Windows Server person... linux package management flummoxes me sometimes.

---

<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:** [15 February 2022 02:27 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350/8 "2022-02-15T02:27:00Z")

</div>

Impatience and open source rarely make good bedfellows 😀

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [15 February 2022 02:28 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350/9 "2022-02-15T02:28:07Z")

</div>

> [@TotallyInformation](#):
>
> For node.js, see [Installing Node.js via package manager | Node.js (nodejs.org)](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)

Perfect- thanks - reinstalled as per the instructions, and everything worked. Probably should have done that to start with 🙂

---

<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:** [1 March 2022 02:28 UTC](https://discourse.nodered.org/t/npm-does-not-support-node-js-v10-19-0-ubuntu/58350/10 "2022-03-01T02:28:22Z")

</div>

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