# Pi: Lost Palette manager, can't update

**URL:** <https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924>\
**Category:** General\
**Created:** [19 June 2018 12:56 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924 "2018-06-19T12:56:32Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 09:02 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/21 "2018-06-20T09:02:45Z")

</div>

Oh, god! I’m contagious! 😂

---

<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:** [20 June 2018 09:04 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/22 "2018-06-20T09:04:52Z")

</div>

What do you see for

```bash
node -v
npm -v

```

---

<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:** [20 June 2018 09:05 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/23 "2018-06-20T09:05:58Z")

</div>

and what sort of pi is it?

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 09:08 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/24 "2018-06-20T09:08:05Z")

</div>

I see the same as before:

> pi@raspberrypi:~ $ node -v  
> v4.2.1  
> pi@raspberrypi:~ $ npm -v  
> ERROR: npm is known not to run on Node.js v4.2.1  
> Node.js 4 is supported but the specific version you're running has  
> a bug known to break npm. Please update to at least 4.7.0 to use this  
> version of npm. You can find the latest release of Node.js at [https://nodejs.org/](https://nodejs.org/)  
> pi@raspberrypi:~ $

And it's a 3B, the latest version. But I tried the same image in a Pi 1, and I had the same result there.

Edit: And I did not use the same image again on the 3B, both were copies of the image on the production Pi.

---

<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:** [20 June 2018 09:20 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/25 "2018-06-20T09:20:12Z")

</div>

What do you see for

```bash
apt-cache policy nodejs
apt-cache policy npm
ls /etc/apt/sources.list.d

```

and if the last shows a file whose name has something like nodesource in it then

```bash
cat /etc/apt/sources.list.d/whatever-the-file-is-called

```

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 09:29 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/26 "2018-06-20T09:29:05Z")

</div>

```
pi@raspberrypi:~ $ apt-cache policy nodejs
nodejs:
  Installed: 6.14.3-1nodesource1
  Candidate: 6.14.3-1nodesource1
  Version table:
 *** 6.14.3-1nodesource1 500
        500 https://deb.nodesource.com/node_6.x stretch/main armhf Packages
        100 /var/lib/dpkg/status
     4.8.2~dfsg-1 500
        500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
pi@raspberrypi:~ $ apt-cache policy npm
npm:
  Installed: (none)
  Candidate: 1.4.21+ds-2
  Version table:
     1.4.21+ds-2 500
        500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
pi@raspberrypi:~ $ ls /etc/apt/sources.list.d
nodesource.list raspi.list
pi@raspberrypi:~ $ cat /etc/apt/sources.list.d/whatever-the-file-is-called
cat: /etc/apt/sources.list.d/whatever-the-file-is-called: No such file or directory
pi@raspberrypi:~ $ cat /etc/apt/sources.list.d/nodesource.list
deb https://deb.nodesource.com/node_6.x stretch main
deb-src https://deb.nodesource.com/node_6.x stretch main
pi@raspberrypi:~ $ 

```

And yes, the second to last command is meant as a joke! 😉

---

<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:** [20 June 2018 09:37 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/27 "2018-06-20T09:37:16Z")

</div>

That is not what I expected, it says nodejs 6.14.3 is installed but you said `node -v` showed node 4. Can you just check that for me and say what `which node` shows.

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 09:38 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/28 "2018-06-20T09:38:17Z")

</div>

It still says v4.2.1 when I run node -v.

---

<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:** [20 June 2018 09:39 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/29 "2018-06-20T09:39:30Z")

</div>

You didn’t say what the command `which node` shows.

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 09:41 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/30 "2018-06-20T09:41:16Z")

</div>

Oh, sorry. This was not a joke… This was me being an ididot. `/usr/local/bin/node`

---

<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:** [20 June 2018 09:44 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/31 "2018-06-20T09:44:29Z")

</div>

That’s it. Somehow you have installed a local copy of node. No idea how. Now we need to get rid of it, what do you see for

```bash
ls -l /usr/local/bin/node*
ls -l /usr/local/bin/npm*

```

Just want to check what is there before deleting it.

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 09:46 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/32 "2018-06-20T09:46:34Z")

</div>

Fantastic that you were able to find out that! 🙂 I see that it goes far back, it's on all my production Pi's.

> pi@raspberrypi:~ $ ls -l /usr/local/bin/node\*  
> -rwxr-xr-x 1 root staff 11949036 Oct 17 2015 /usr/local/bin/node  
> pi@raspberrypi:~ $ ls -l /usr/local/bin/npm\*  
> lrwxrwxrwx 1 root root 38 Apr 21 18:03 /usr/local/bin/npm -\> ../lib/node\_modules/npm/bin/npm-cli.js  
> pi@raspberrypi:~ $

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 09:50 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/33 "2018-06-20T09:50:36Z")

</div>

It’s been there since before I installed Home Assistant, so it’s a very long time.

---

<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:** [20 June 2018 10:00 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/35 "2018-06-20T10:00:16Z")

</div>

Ok, lets get rid of those and try again. I can’t remember what state npm is in so lets use the sledgehammer again.

```auto
sudo rm /usr/local/bin/node*
sudo rm /usr/local/bin/npm*
sudo apt-get remove nodejs npm
sudo rm /etc/apt/sources.list.d/nodesource.list
sudo rm /usr/bin/node*
sudo rm /usr/bin/npm*
sudo rm /var/log/nodered-install.log

```

The last is to remove all the old install log contents as it adds to it each time.  
Then run the bash \<(curl command again.  
If it fails again at the same point paste the log here, it should be shorter this time.

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 10:21 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/36 "2018-06-20T10:21:44Z")

</div>

I think you’re really on to something now! 🙂 But something is not fully done, this is what I got:

```
Running Node-RED update for user pi at /home/pi

This can take 20-30 minutes on the slower Pi versions - please wait.

  Stop Node-RED ✔
  Remove old version of Node-RED ✔
  Remove old version of Node.js ✔
  Install Node.js LTS ✔ Node v8.11.3 Npm 5.6.0
  Clean npm cache ✔
  Install Node-RED core ✔   
  Move global nodes to local -
  Install extra Pi nodes -
  Npm rebuild existing nodes ✔
  Add menu shortcut ✔
  Update systemd script ✔
  Update update script ✔

Any errors will be logged to /var/log/nodered-install.log

All done.
  You can now start Node-RED with the command node-red-start
  or using the icon under Menu / Programming / Node-RED
  Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started Wed Jun 20 12:13:22 CEST 2018 - Finished Wed Jun 20 12:15:52 CEST 2018

pi@raspberrypi:~ $ node-red-start

Node-RED is not yet fully installed

Fetching Node-RED update.

 
This script will remove versions of Node.js prior to version 6.x, and Node-RED and
if necessary replace them with Node.js 8.x LTS (carbon) and the latest Node-RED from Npm.
 
It also moves any Node-RED nodes that are globally installed into your user
~/.node-red/node_modules directory, and adds them to your package.json, so that
you can manage them with the palette manager.
 
It also tries to run 'npm rebuild' to refresh any extra nodes you have installed
that may have a native binary component. While this normally works ok, you need
to check that it succeeds for your combination of installed nodes.
 
To do all this it runs commands as root - please satisfy yourself that this will
not damage your Pi, or otherwise compromise your configuration.
If in doubt please backup your SD card first.
 
Are you really sure you want to do this ? [y/N] ?

```

My guess is that I am really sure I want to do this. 😉

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 10:29 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/37 "2018-06-20T10:29:46Z")

</div>

Yeah, I really wanted to do this! Now it works, I have Palette manager back! Thanks a lot for your help, sir! Now I will do the same process (removing the local node.js copy and update) a copy of each of the production images and run them.

---

<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:** [20 June 2018 10:32 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/38 "2018-06-20T10:32:45Z")

</div>

Excellent. It should not really have taken me as long to realise what was happening. The clues were there.

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 10:37 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/39 "2018-06-20T10:37:25Z")

</div>

For you, maybe. For me? More like black magic with all these commands and weird directories. I was pretty good at DOS 3.22, but I guess I have forgotten a lot of that… Thanks again for the help!

---

<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:** [20 June 2018 16:43 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/40 "2018-06-20T16:43:01Z")

</div>

The odd thing about this is that the bash update script should automatically look in /usr/local (and remove any old node.js in there) if run as per the docs.

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [20 June 2018 17:10 UTC](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924/41 "2018-06-20T17:10:31Z")

</div>

Well, the odd is sort of my signature… 😉 Sort of like a walkingf Murphy’s law - if anything can go wrong, it will go wrong for me!

[Previous page](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924.md?page=1)

[Next page](https://discourse.nodered.org/t/pi-lost-palette-manager-cant-update/924.md?page=3)
