# Major Issue updating Node and Node Red

**URL:** <https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516>\
**Category:** General\
**Created:** [11 July 2018 15:19 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516 "2018-07-11T15:19:11Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![fragolinux](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fragolinux/32/1137_2.png) [@fragolinux](https://discourse.nodered.org/u/fragolinux)\
**Post date:** [12 July 2018 09:00 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/21 "2018-07-12T09:00:02Z")

</div>

i know this is not strictly node-red related, but as it happens while installing nodejs from stock node repositories, sometimes, i'm just asking what's happening globally to these repositories, both of ubuntu and debian...

---

<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:** [12 July 2018 12:32 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/22 "2018-07-12T12:32:12Z")

</div>

[Edited]  
@dynamicdave, The reason for failure should be in the node red log. Run node-red-log in a terminal to see it, however I don't think this is relevant to this thread, you might be better starting a new one.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [12 July 2018 15:03 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/24 "2018-07-12T15:03:48Z")

</div>

I've given up trying to sort this out and re-flashed the RPi-3 mirco SD card.  
I've installed all the nodes I was using but can't sort out this one. sqlite  
I get this error message. And yes when I go to the directory it is empty.  
i.e. node\_sqlite3.node is missing

12 Jul 15:45:23 - [warn] [node-red-node-sqlite/sqlite] Error: Cannot find module '/home/pi/.node-red/node\_modules/sqlite3/lib/binding/node-v57-linux-arm/node\_sqlite3.node' (line:4)

Any advice would be appreciated.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2018 15:35 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/25 "2018-07-12T15:35:13Z")

</div>

I think you need to install sqlite separately  
`sudo apt-get install sqlite3`

opening a new thread about sqlite

---

<div class="post-metadata">

**Author:** ![SteveMann](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stevemann/32/3810_2.png) [@SteveMann](https://discourse.nodered.org/u/SteveMann)\
**Post date:** [12 July 2018 16:08 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/26 "2018-07-12T16:08:17Z")

</div>

> [@wb666greene](#):
>
> I'm watching this thread for a solution. I was about to upgrade a Pi that I don't want to break to test the fix posted by the author of node-red-contrib-ftp-server to allow it to use node 8.x

I haven't tried to upgrade yet, but...  
I do make a copy of the SD card from time to time. In other projects it's saved me loads of hours. I screw up so often that I never start a significant operation without a very recent backup SD card.

You need an SD card with Raspian OS on it.  
You need an HDMI display.  
Remove the SD with Home Assistant on it. (Mark it "HA" so that you don't mix it up and accidentally write over it).  
Insert the Raspian SD card and boot the Pi.  
Insert the "HA" SD card into a USB adapter, then plug it into the Pi. (It will likely mount as /dev/sda\*)  
Insert a new "Backup" SD card into another USB adapter, then plug it into the Pi. (It will likely mount as /dev/sdb  
Under "Accessories" select the "Copy SD card" option.  
Then copy sda to sdb.

Now, if I brick my HA installation, I just follow the above procedure to copy my backup back to the "HA" SD card.

Hope this helps....  
Steve Mann

**EDIT**

Whoops, right answer, wrong forum....🤔

But I'll leave it up since the copy procedure still works.  
Steve

---

<div class="post-metadata">

**Author:** ![igorantolic](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/igorantolic/32/51697_2.png) [@igorantolic](https://discourse.nodered.org/u/igorantolic)\
**Post date:** [12 July 2018 17:51 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/27 "2018-07-12T17:51:53Z")

</div>

This solution WORKED for me:

> If that fails then delete  
> /etc/apt/sources.list.d/nodesource.list  
> And then re-run

Install Node.js LTS ✔ Node v8.11.3 Npm 5.6.0

---

<div class="post-metadata">

**Author:** ![BKFC](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@BKFC](https://discourse.nodered.org/u/BKFC)\
**Post date:** [18 January 2019 17:04 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/29 "2019-01-18T17:04:52Z")

</div>

I'm running Raspberry Pi with jesse OS and I also get this message:

Update Node.js LTS ✘ Failed to install Node.js - Exit

My goal is to replace my version of node-red, which is something like 0.x. (node-red-dashboard installs but does not run with this version)

I have no file /etc/apt/sources.list.d/nodesource.list to delete.

I have no experience with node-red, and I don't know what to try next.

---

<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:** [18 January 2019 17:06 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/30 "2019-01-18T17:06:04Z")

</div>

what do the commands

```
node -v
npm -v

```

return ?

---

<div class="post-metadata">

**Author:** ![BKFC](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@BKFC](https://discourse.nodered.org/u/BKFC)\
**Post date:** [18 January 2019 17:23 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/31 "2019-01-18T17:23:54Z")

</div>

The both return "Command not found"

---

<div class="post-metadata">

**Author:** ![BKFC](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@BKFC](https://discourse.nodered.org/u/BKFC)\
**Post date:** [18 January 2019 17:26 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/32 "2019-01-18T17:26:48Z")

</div>

I'm running the script that I get from the following:

curl -sL [https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

...and this is the output:

Stop Node-RED ✔  
Remove old version of Node-RED ✔  
Remove old version of Node.js ✔  
Install Node.js LTS ✘ Failed to install Node.js - Exit  
Clean npm cache  
Install Node-RED core  
Move global nodes to local  
Install extra Pi nodes  
Npm rebuild existing nodes  
Add shortcut commands  
Update systemd script

---

<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:** [18 January 2019 18:02 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/33 "2019-01-18T18:02:10Z")

</div>

Post the log please (it tells you where it is at the end of the install)

---

<div class="post-metadata">

**Author:** ![Rulevalley](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@Rulevalley](https://discourse.nodered.org/u/Rulevalley)\
**Post date:** [6 March 2019 14:34 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/34 "2019-03-06T14:34:09Z")

</div>

Hi. have installed the debian on a laptop. And running the script for Node-red installation.

I have deleted the file /etc/apt/sources.list.d/nodesource.list  
I have ran it some times, and with a few reboots.

Still the same result -

Output :

```auto

Running Node-RED install 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 ✔
  Update Node.js LTS ✘ Failed to install Node.js - Exit
  Clean npm cache
  Install Node-RED core
  Move global nodes to local
  Install extra Pi nodes
  Npm rebuild existing nodes
  Add shortcut commands
  Update systemd script

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

```

Logfile Ending -

> Funnet:5 [Index of /debian](http://ftp.debian.org/debian) stretch-updates InRelease  
> Funnet:6 [Index of /debian](http://ftp.debian.org/debian) stretch Release  
> Funnet:7 [https://deb.nodesource.com/node\_10.x](https://deb.nodesource.com/node_10.x) stretch InRelease  
> Leser pakkelister...
> 
> ## Run `sudo apt-get install -y nodejs` to install Node.js 10.x and npm
> 
> ## You may also need development tools to build native addons:
> 
> ```
> sudo apt-get install gcc g++ make
> 
> ```
> 
> ## To install the Yarn package manager, run:
> 
> ```
> curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
> echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/$
> sudo apt-get update && sudo apt-get install yarn
> 
> ```
> 
> Leser pakkelister...  
> Skaper oversikt over avhengighetsforhold...  
> Leser tilstandsinformasjon...  
> Følgende NYE pakker vil bli installert:  
> nodejs  
> N: Ignoring file 'yarn.l$' in directory '/etc/apt/sources.list.d/' as it has an$  
> 0 oppgraderte, 1 nylig installerte, 0 å fjerne og 0 ikke oppgradert.  
> Må hente 0 B/4 860 kB med arkiver.  
> Etter denne operasjonen vil 18,1 MB ekstra diskplass bli brukt.  
> Selecting previously unselected package nodejs.  
> (Leser database ... ^M(Leser database ... 5%^M(Leser database ... 10%^M(Leser d$  
> Preparing to unpack .../nodejs\_8.11.1~dfsg-2~bpo9+1\_i386.deb ...  
> Unpacking nodejs (8.11.1~dfsg-2~bpo9+1) ...  
> Setter opp nodejs (8.11.1~dfsg-2~bpo9+1) ...  
> update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto $  
> Processing triggers for man-db (2.7.6.1-2) ...

Does anyone have an advice for further action ?

Regards

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [6 March 2019 18:42 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/35 "2019-03-06T18:42:19Z")

</div>

Did you follow the direction to install node.js as it tells you to do in the log?

---

<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:** [6 March 2019 20:41 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/36 "2019-03-06T20:41:35Z")

</div>

That looks as if it has installed nodejs 8.x which is odd as it has included the 10.x repository. What does `apt-cache policy nodejs` show? Also `node -v` and `npm -v`.

---

<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:** [6 March 2019 21:57 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/37 "2019-03-06T21:57:17Z")

</div>

by deleting the apt sources it has fallen back to the default debian install which is 8.11 - yuk... I would `apt-get purge nodejs` - then check that the `/etc/apt/sources.list.d/` directory still does not contain `nodesource.list`, then run `sudo apt-get update` to refresh the sources. And then retry our install script.

---

<div class="post-metadata">

**Author:** ![Rulevalley](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@Rulevalley](https://discourse.nodered.org/u/Rulevalley)\
**Post date:** [7 March 2019 08:49 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/38 "2019-03-07T08:49:31Z")

</div>

Thanks for the advice's.

I made a clean instalation of the Debian, and installed it not by the script, but by the use of description on  
[https://nodered.org/docs/getting-started/installation](https://nodered.org/docs/getting-started/installation)

Then it works like a charm.

---

<div class="post-metadata">

**Author:** ![stulander](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@stulander](https://discourse.nodered.org/u/stulander)\
**Post date:** [28 August 2019 14:04 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/39 "2019-08-28T14:04:39Z")

</div>

Using stretch 2019-04-08 I get this after a clean install and running apt-get update.

There is no nodesource.list.

```auto
Started : Mon 8 Apr 12:05:33 BST 2019
Running for user pi at /home/pi
Failed to stop nodered.service: Unit nodered.service not loaded.
Found global nodes: :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  gyp javascript-common libc-ares2 libhttp-parser2.8 libjs-inherits
  libjs-jquery libjs-node-uuid libjs-underscore libssl-dev libssl-doc libuv1
  libuv1-dev nodejs-doc python-pkg-resources
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.
Now install nodejs

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'npm' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  gyp javascript-common libc-ares2 libhttp-parser2.8 libjs-inherits
  libjs-jquery libjs-node-uuid libjs-underscore libssl-dev libssl-doc libuv1
  libuv1-dev nodejs-doc python-pkg-resources
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.
dpkg: warning: ignoring request to remove nodejs which isn't installed
dpkg: warning: ignoring request to remove node which isn't installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  gyp javascript-common libc-ares2 libhttp-parser2.8 libjs-inherits
  libjs-jquery libjs-node-uuid libjs-underscore libssl-dev libssl-doc libuv1
  libuv1-dev nodejs-doc python-pkg-resources
0 upgraded, 0 newly installed, 14 to remove and 32 not upgraded.
After this operation, 19.3 MB disk space will be freed.
(Reading database ... 38348 files and directories currently installed.)
Removing gyp (0.1+20150913git1f374df9-1) ...
Removing javascript-common (11) ...
Removing libc-ares2:armhf (1.14.0-1~bpo9+1) ...
Removing libhttp-parser2.8:armhf (2.8.1-1~bpo9+1) ...
Removing libjs-inherits (2.0.3-1) ...
Removing libjs-jquery (3.1.1-2+deb9u1) ...
Removing libjs-node-uuid (1.4.0-1) ...
Removing libjs-underscore (1.8.3~dfsg-1) ...
Removing libssl-dev:armhf (1.1.0k-1~deb9u1) ...
Removing libssl-doc (1.1.0k-1~deb9u1) ...
Removing libuv1-dev:armhf (1.18.0-3~bpo9+1) ...
Removing libuv1:armhf (1.18.0-3~bpo9+1) ...
Removing nodejs-doc (8.11.1~dfsg-2~bpo9+1) ...
Removing python-pkg-resources (33.1.1-1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for man-db (2.7.6.1-2) ...

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Reading package lists...
Building dependency tree...
Reading state information...
32 packages can be upgraded. Run 'apt list --upgradable' to see them.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.52.1-5+deb9u9).
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libc-ares2 libhttp-parser2.8 libuv1 nodejs-doc
The following NEW packages will be installed:
  libc-ares2 libhttp-parser2.8 libuv1 nodejs nodejs-doc
0 upgraded, 5 newly installed, 0 to remove and 32 not upgraded.
Need to get 5,087 kB of archives.
After this operation, 22.2 MB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian stretch/main armhf libc-ares2 armhf 1.14.0-1~bpo9+1 [80.7 kB]
Get:2 http://archive.raspberrypi.org/debian stretch/main armhf libhttp-parser2.8 armhf 2.8.1-1~bpo9+1 [19.3 kB]
Get:3 http://archive.raspberrypi.org/debian stretch/main armhf libuv1 armhf 1.18.0-3~bpo9+1 [86.3 kB]
Get:4 http://archive.raspberrypi.org/debian stretch/main armhf nodejs armhf 8.11.1~dfsg-2~bpo9+1 [4,126 kB]
Get:5 http://archive.raspberrypi.org/debian stretch/main armhf nodejs-doc all 8.11.1~dfsg-2~bpo9+1 [775 kB]
Fetched 5,087 kB in 2s (1,942 kB/s)
Selecting previously unselected package libc-ares2:armhf.
(Reading database ... 34740 files and directories currently installed.)
Preparing to unpack .../libc-ares2_1.14.0-1~bpo9+1_armhf.deb ...
Unpacking libc-ares2:armhf (1.14.0-1~bpo9+1) ...
Selecting previously unselected package libhttp-parser2.8:armhf.
Preparing to unpack .../libhttp-parser2.8_2.8.1-1~bpo9+1_armhf.deb ...
Unpacking libhttp-parser2.8:armhf (2.8.1-1~bpo9+1) ...
Selecting previously unselected package libuv1:armhf.
Preparing to unpack .../libuv1_1.18.0-3~bpo9+1_armhf.deb ...
Unpacking libuv1:armhf (1.18.0-3~bpo9+1) ...
Selecting previously unselected package nodejs.
Preparing to unpack .../nodejs_8.11.1~dfsg-2~bpo9+1_armhf.deb ...
Unpacking nodejs (8.11.1~dfsg-2~bpo9+1) ...
Selecting previously unselected package nodejs-doc.
Preparing to unpack .../nodejs-doc_8.11.1~dfsg-2~bpo9+1_all.deb ...
Unpacking nodejs-doc (8.11.1~dfsg-2~bpo9+1) ...
Setting up nodejs-doc (8.11.1~dfsg-2~bpo9+1) ...
Setting up libuv1:armhf (1.18.0-3~bpo9+1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libc-ares2:armhf (1.14.0-1~bpo9+1) ...
Setting up libhttp-parser2.8:armhf (2.8.1-1~bpo9+1) ...
Setting up nodejs (8.11.1~dfsg-2~bpo9+1) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Processing triggers for libc-bin (2.24-11+deb9u4) ...
sudo: npm: command not found

```

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [28 August 2019 14:06 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/40 "2019-08-28T14:06:53Z")

</div>

> [@stulander](#):
>
> Using stretch 2019-04-08 I get this after a clean install and running apt-get update.

What about if you follow the recommended way in the docs?

---

<div class="post-metadata">

**Author:** ![Btazbt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/btazbt/32/14434_2.png) [@Btazbt](https://discourse.nodered.org/u/Btazbt)\
**Post date:** [19 November 2019 21:46 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/41 "2019-11-19T21:46:19Z")

</div>

I had the same issue mentioned in this thread. after following the suggestion in this post (purge & update), the installation script was successful.

---

<div class="post-metadata">

**Author:** ![garynl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garynl/32/95490_2.png) [@garynl](https://discourse.nodered.org/u/garynl)\
**Post date:** [27 March 2020 16:33 UTC](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516/43 "2020-03-27T16:33:33Z")

</div>

This suddenly started happening this morning. Tried the suggestions earlier in the thread but to no avail. Resigned to having to reconstruct the configuration from scratch.

[Previous page](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516.md?page=1)

[Next page](https://discourse.nodered.org/t/major-issue-updating-node-and-node-red/1516.md?page=3)
