Major Issue updating Node and Node Red

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.

Not sure what you mean by that. The problem described here is a problem with updating node red so how can it suddenly have started happening?

yes, sorry, it wasn't very clear. I got the same error as the original poster when I used the bash script to update node red on my pi3b. I last did this some time in January and it worked without any problems. While trying the suggested solutions I noticed the original post was a couple of years old, so has this issue resurfaced?

gary

Not that we are aware of. What does the log report ?

There is not much in the install log


'''***************************************

Started : Sat Mar 28 00:06:14 CET 2020
Running for user openhabian at /home/openhabian
Found global nodes:   :

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

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Now install nodejs'''

I found nodejs was already installed when I did as suggested. I then installed nodered:

openhabian@openHABianPi:~$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree        
Reading state information... Done
nodejs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[14:03:06] openhabian@openHABianPi:~$ sudo apt-get install nodered
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  nodejs-legacy
The following NEW packages will be installed:
  nodejs-legacy nodered
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,372 kB of archives.
After this operation, 140 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.raspberrypi.org/debian/ jessie/main nodered armhf 0.15.3-1 [5,292 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main nodejs-legacy all 0.10.29~dfsg-2 [80.4 kB]
Fetched 5,372 kB in 1s (3,777 kB/s)                                   
On branch master
Changes not staged for commit:
	modified:   openhab2/scripts/njsTuya (modified content, untracked content)
	modified:   openhab2/scripts/openhab2_pub_001 (modified content, untracked content)
	modified:   openhab2/scripts/tuyapi (modified content)

no changes added to commit
warning: etckeeper failed to commit changes in /etc using git
Selecting previously unselected package nodejs-legacy.
(Reading database ... 52739 files and directories currently installed.)
Preparing to unpack .../nodejs-legacy_0.10.29~dfsg-2_all.deb ...
Unpacking nodejs-legacy (0.10.29~dfsg-2) ...
Selecting previously unselected package nodered.
Preparing to unpack .../nodered_0.15.3-1_armhf.deb ...
Unpacking nodered (0.15.3-1) ...
Processing triggers for man-db (2.7.5-1~bpo8+1) ...
Processing triggers for mime-support (3.58) ...
Setting up nodejs-legacy (0.10.29~dfsg-2) ...
Setting up nodered (0.15.3-1) ...
On branch master
Changes not staged for commit:
	modified:   openhab2/scripts/njsTuya (modified content, untracked content)
	modified:   openhab2/scripts/openhab2_pub_001 (modified content, untracked content)
	modified:   openhab2/scripts/tuyapi (modified content)

no changes added to commit
warning: etckeeper failed to commit changes in /etc using git
Updating FireMotD available updates count ... '''

When I run 'node -V' I get the following output:

node -V
node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)

I think this is probably the root cause of the problem but I have no idea what to do to correct this or what I could have done to cause this.

Thanks
gary

The 400 (Bad Request) status code indicates that the server cannot or will not process the request because the received syntax is invalid, nonsensical, or exceeds some limitation on what the server is willing to process. It means that the request itself has somehow incorrect or corrupted and the server couldn't understand it. The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method . Therefore, it prevents the website from being properly displayed. The main thing to understand is that the 400 Bad Request error is a client-side error.

The cause of 400 Bad Request error can be a wrongly written URL or a URL that contains unrecognizable characters. Another cause of the error might be an invalid or expired cookie. Also, if you try to upload a file that's too large. If the server is programmed with a file size limit, then you might encounter a 400 error.

Hi & welcome to the forum.

The post you responded to is from 3 years ago and I'm sure by now they either gave up or got things fixed.

The info you provided is appreciated but this thread is now too old to be relevant too today's version of node-red so to save further confusion, this thread will be closed.

Thanks for taking the time to respond.