# Upgrade on raspberry pi failed

**URL:** <https://discourse.nodered.org/t/upgrade-on-raspberry-pi-failed/6266>\
**Category:** General\
**Created:** [31 December 2018 22:45 UTC](https://discourse.nodered.org/t/upgrade-on-raspberry-pi-failed/6266 "2018-12-31T22:45:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScottChapman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scottchapman/32/4838_2.png) [@ScottChapman](https://discourse.nodered.org/u/ScottChapman)\
**Post date:** [31 December 2018 22:45 UTC](https://discourse.nodered.org/t/upgrade-on-raspberry-pi-failed/6266/1 "2018-12-31T22:45:47Z")

</div>

So, I was using the recommended method for upgrading node-red on my raspberry pi:  
[https://nodered.org/docs/hardware/raspberrypi](https://nodered.org/docs/hardware/raspberrypi)  
but it failed to install nodejs for armv6. looking at the log I see this:

```auto
/usr/lib/node_modules/npm/node_modules/npmlog/log.js:57
log.progressEnabled = log.gauge.isEnabled()
                                ^

TypeError: log.gauge.isEnabled is not a function
    at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/npmlog/log.js:57:33)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at /usr/lib/node_modules/npm/bin/npm-cli.js:22:13
    at Object.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:153:3)

```

---

<div class="post-metadata">

**Author:** ![ScottChapman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scottchapman/32/4838_2.png) [@ScottChapman](https://discourse.nodered.org/u/ScottChapman)\
**Post date:** [31 December 2018 22:52 UTC](https://discourse.nodered.org/t/upgrade-on-raspberry-pi-failed/6266/2 "2018-12-31T22:52:52Z")

</div>

Oh, interesting. Looks like I have node V10.15.0 but when I try to run `npm -v` I get the error above.

---

<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:** [1 January 2019 10:49 UTC](https://discourse.nodered.org/t/upgrade-on-raspberry-pi-failed/6266/3 "2019-01-01T10:49:05Z")

</div>

Others in simlar situations have found that running the following commands to forcefully remove node and npm and then running the upgrade script, works for them. Note that if you use node.js for things other than node red then you might not want to do this as it removes all globally installed nodes. The node red install will put back the ones it needs but not others.

```bash
cd /usr/lib
sudo rm -rf node_modules
cd ~
sudo rm /usr/bin/node
sudo rm /usr/bin/npm

```

**Note, be very careful, particularly with the rm -rf command.** Some suggest using `sudo rm -rf /usr/lib/node_modules` but I prefer to cd to /usr/lib then run the command on node\_modules. The reason is that with the former command, if one accidentally put a space after the first / then it becomes a command that would completely remove everything from / downwards, so deleting your complete system.
