# Npm, versioning and palette manager confusions

**URL:** <https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064>\
**Category:** General\
**Created:** [12 April 2021 20:15 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064 "2021-04-12T20:15:26Z")\
**Posts on this page:** 17\
**Page:** 4

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [16 April 2021 07:58 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/61 "2021-04-16T07:58:34Z")

</div>

Well - as long as the updating nodes went ok - (does `npm outdated` report anything ?) - then you should be ok to push node.js up to 14 (as per [Npm, versioning and palette manager confusions - #52 by dceejay](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/52))

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 April 2021 09:48 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/62 "2021-04-16T09:48:42Z")

</div>

Or you should be able to get to 12 by running  
`sudo apt remove nodejs`  
then running the install script. That should work ok now that all your nodes are up to date. Or when you say that none of the suggestions have worked that this still doesn't work. In which case we need the log to work out why.

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [16 April 2021 12:28 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/63 "2021-04-16T12:28:21Z")

</div>

Hi Dave

I've just now ran npm outdated....

Package Current Wanted Latest Location  
dateformat 3.0.3 3.0.3 4.5.1 global  
node-red-node-sqlite 0.3.7 0.3.7 0.6.0 global  
pi@rpi419buster:~:14:26[1]\>

No idea why it is showing anything outdated after all the updating I've done.. and updating the two nodes - should there be a -g tag on the update - seems to be suggesting these are global?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 April 2021 13:02 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/64 "2021-04-16T13:02:31Z")

</div>

OK, this is starting to make some sense. Somehow you have installed the sqlite node globally, so it isn't getting updated. I suggest you remove it  
`npm remove -g node-red-node-sqlite`  
then make sure it is installed locally  
`npm i --unsafe-perm node-red-node-sqlite`  
note, no -g, and restart node-red. I don't know why you have dateformat installed. Is it something you use in your flows? It probably isn't relevant to the issues here.

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [16 April 2021 14:57 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/65 "2021-04-16T14:57:24Z")

</div>

It gets even more complicated.. I did the install as you requested – from the pi folder….

Result was: up to date in 0.092s

So, I did the same again without the -g

Result was a proper uninstall.

I then checked the .node-red folder – still had a sqlite install in there…. So… I uninstalled THAT (without the -g).

Could you please confirm therefore – what folder should I be sitting in, in order to do the new install?

While waiting I tried going into NR (no sqlite) and used the pallette manager to install sqlite - that failed...(after stopping and restarting NR). So I uninstalled the sqlite it installed into /home/pi/.node-red/node\_modules.... and installed it the way you suggested above - from the /home/pi folder...a long time later (but no ERRORS)... I ended up with sqlite in the home/pi/node\_modules folder and ran node-red...

STILL no sqlite - yet before I started all of this I had SQLITE working (remember I'm on nodejs 10).

😊  
Finally, the non-global --unsafe-perm version in .node-red folder - restarted node-red - works...

but now. npm outdated returns:

```auto
Package Current Wanted Latest Location
dateformat 3.0.3 3.0.3 4.5.1 global
sqlite3 4.0.9 4.2.0 5.0.2 global

```

I thought the point of this was to install the latest sqlite?

```auto
Welcome to Node-RED
===================

16 Apr 17:31:43 - [info] Node-RED version: v1.3.2
16 Apr 17:31:43 - [info] Node.js version: v10.24.1
16 Apr 17:31:43 - [info] Linux 5.10.17-v7l+ arm LE
16 Apr 17:31:44 - [info] Loading palette nodes
16 Apr 17:31:49 - [info] Worldmap version 2.13.2
16 Apr 17:31:49 - [info] Dashboard version 2.28.2 started at /ui
16 Apr 17:31:50 - [info] Settings file : /home/pi/.node-red/settings.js
16 Apr 17:31:50 - [info] HTTP Static : /home/pi/.node-red/public
16 Apr 17:31:50 - [info] Context store : 'default' [module=localfilesystem]
16 Apr 17:31:50 - [info] User directory : /home/pi/.node-red
16 Apr 17:31:50 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
16 Apr 17:31:50 - [info] Flows file : /home/pi/.node-red/flows.json
16 Apr 17:31:50 - [info] Server now running at http://127.0.0.1:1880/
16 Apr 17:31:50 - [info] Starting flows
16 Apr 17:31:52 - [info] Started flows
16 Apr 17:31:52 - [info] [sqlitedb:6e9a0125.59bc4] opened /home/pi/dbs/iot.db ok
16 Apr 17:31:52 - [info] [sqlitedb:fdbe27fe.fb7848] opened /home/pi/dbs/iot.db ok
16 Apr 17:31:52 - [info] [sqlitedb:33875a87.57ade6] opened /home/pi/dbs/iot.db ok
16 Apr 17:31:52 - [info] [tasmota-mqtt-broker:34268cd3.bfa344] Connected to broker: mqtt://127.0.0.1:1883
16 Apr 17:31:52 - [info] [mqtt-broker:4c682b3a.2ab5c4] Connected to broker: mqtt://127.0.0.1:1883
16 Apr 17:31:59 - [info] [e-mail:peterscargill@gmail.com] Message sent: 250 2.0.0 OK 1618587119 m15sm7803175wrx.32 - gsmtp

```

Pete

---

<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:** [16 April 2021 16:36 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/66 "2021-04-16T16:36:02Z")

</div>

Hi Pete.

All nodes should be installed into the userDir (~/.node-red). Only Node-RED itself should be installed globally.

The only real reason to install any npm package globally is for when a package implements a command line command that you want to be able to run anywhere. Everything else should be locally installed.

If you get stuck with something, you can always just delete it manually. For a globally installed package, you can find out where it lives with:

```auto
npm -g list npm-module-name

```

On my Debian system, that is `/usr/lib/node_modules/`. Just delete the folder with the matching name.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 April 2021 21:03 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/67 "2021-04-16T21:03:19Z")

</div>

> [@scargill](#):
>
> ```auto
> Package Current Wanted Latest Location
> dateformat 3.0.3 3.0.3 4.5.1 global
> sqlite3 4.0.9 4.2.0 5.0.2 global
> 
> ```
> 
> I thought the point of this was to install the latest sqlite?

That isn't node-red-contrib-sqlite, that is a global install off the the sqlite3 module. How you have that I have no idea. It shouldn't be necessary as installing the sqlite node should have installed the correct sqlite3 version under it.  
I suggest you uninstall the global sqlite3 module  
`npm remove -g sqlite3`  
and check that the sqlite node has pulled in the correct module.  
`npm list sqlite3` should show

```auto
$ npm list sqlite3
tigger@1.0.0 /home/colinl/.node-red
└─┬ node-red-node-sqlite@0.6.0
  └── sqlite3@4.2.0 

```

That is from the .node-red folder of course. If you do everything from that folder then you won't go wrong, though npm commands with -g don't care where they are run. If sqlite3 doesn't appear there then remove and install the sqlite node again as it must have been confused by the global install.

You might like to remove the dateformat module the same way, but first search for that in the editor to see if you are using it, and check in settings.js in case you have referenced it there.

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [16 April 2021 21:28 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/68 "2021-04-16T21:28:32Z")

</div>

This happened earlier. Same again

npm remove -g sqlite3  
up to date in 0.103s

pi@rpi419buster:~:23:24[130]\> npm list sqlite3  
/home/pi  
└── sqlite3@4.0.9

IfI do that from the .node-red dir

pi@rpi419buster:.node-red:23:26[0]\> npm list sqlite3  
node-red-project@0.0.1 /home/pi/.node-red  
└─┬ node-red-node-sqlite@0.6.0  
└── sqlite3@4.2.0

Dateformat sorted earlier thanks by getting rid of the /home/pi/node\_modules version.

So now it seems "all" I have to do is upgrade node to 14??

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [16 April 2021 22:07 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/69 "2021-04-16T22:07:14Z")

</div>

It WORKED! Wheee..

After all that I did:  
`sudo nano /etc/apt/sources.list.d/nodesource.list`  
(changed the references in there from 10.x to 14.x)  
`sudo apt update && sudo apt full-upgrade`  
and in the .node-red folder....  
`sudo apt update && sudo apt full-upgrade`  
a quick reboot and  
`npm rebuild`  
Then I started Node-Red and ALL IS WELL - thanks a lot guys... I'll upgrade my blog accordingly.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 April 2021 07:48 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/70 "2021-04-17T07:48:57Z")

</div>

> [@scargill](#):
>
> pi@rpi419buster:~:23:24[130]\> npm list sqlite3  
> /home/pi  
> └── sqlite3@4.0.9

That is yet another install of the sqlite3 node, in folder /home/pi. Presumably at some point you installed it manually from that folder. Unless you know that want nodejs modules installed in that folder (which you don't for the usual node-red install) then you can safely remove the folder /home/pi/node\_modules. It is just wasting space.

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [17 April 2021 09:27 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/71 "2021-04-17T09:27:14Z")

</div>

Absolutely right Colin - I got rid of it last night.... indeed I'm wondering why there is a nod\_modules folder at all under /home/pi - it has lots in it and much seems to replicate that in /home/pi/.node-red - remember my installation dates back years as I've slowly added features to my home control and never wanted to start from scratch.

I had a good cleanup day yesterday thanks mainly to feedback from yourself, Dave and Julian - only hindered by problems making SSD clones - but even that may now be resolved - it LOOKS like a dicky USB3-to SATA connector as I replaced one lead and now I have 4 SSD clones of yesterday's success. I may well investigate if that /home/pi/node\_modules folder is even necessary if my run of luck continues.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 April 2021 10:17 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/72 "2021-04-17T10:17:24Z")

</div>

The /home/pi/node\_modules folder is probably as a result of occasional attempted installations from the home folder instead of .node-red. It is easy to do. Rename it and you will soon find if it messes anything up. Make a note to delete it in a few weeks if you don't find a problem.

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [17 April 2021 11:01 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/73 "2021-04-17T11:01:28Z")

</div>

Thanks Colin - I've JUST sat down and I was pondering that - I'll do exactly that to see what happens....  
Done - in /home/pi - mv node\_modules node\_maybe - and I found a huge tar.gz file - thats gone, too.

Everything still works after reboot..... magic.

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [26 April 2021 08:59 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/74 "2021-04-26T08:59:02Z")

</div>

Update - I ditched that /home/pi/node\_modules folder successfully - and all is well - just in time for another update - message this morning said NR 1.3.3 is out - and I only just upgraded to 1.3.2 - oh well 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 April 2021 09:28 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/75 "2021-04-26T09:28:51Z")

</div>

If you just want to install a node-red upgrade then all you need do is  
`sudo npm install -g --unsafe-perm node-red`

---

<div class="post-metadata">

**Author:** ![scargill](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scargill/32/1118_2.png) [@scargill](https://discourse.nodered.org/u/scargill)\
**Post date:** [26 April 2021 09:32 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/78 "2021-04-26T09:32:00Z")

</div>

MMM, updating NR to 3.3 all went well except that "Manage Palette" produced "Failed to load node catalog - click on browser console for more information". I restarted the browser on my PC, nothing happened. I erbooted my Rsapberry Pi 4 and all is well. Colin - I just saw your post above now... I coudl have done that - but I used the usual upgrade script. All seems well.

---

<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:** [25 June 2021 09:32 UTC](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064/79 "2021-06-25T09:32:26Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/npm-versioning-and-palette-manager-confusions/44064.md?page=3)
