Major Issue updating Node and Node Red

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...

[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.

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.

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

opening a new thread about sqlite

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....:thinking:

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

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 :heavy_check_mark: Node v8.11.3 Npm 5.6.0

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.

what do the commands

node -v
npm -v

return ?

The both return "Command not found"

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

...and this is the output:

Stop Node-RED :heavy_check_mark:
Remove old version of Node-RED :heavy_check_mark:
Remove old version of Node.js :heavy_check_mark:
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

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

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 :


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 stretch-updates InRelease
Funnet:6 Index of /debian stretch Release
Funnet:7 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

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

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.

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.

1 Like

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

Then it works like a charm.

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

There is no nodesource.list.

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

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

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

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.