Unable to install on Debian with Raspberry Pi Desktop

Hi,

I am running Debian with Raspberry Pi Desktop which works fine but I cannot install node-red using the official script.

It gave the error:
Update Node.js LTS ✘ Failed to install Node.js - Exit

This are the last few lines from the log file, which is not helpful (in my opinion :slight_smile: just a beginner)

Reading state information...
Suggested packages:
npm
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/86.3 kB of archives.
After this operation, 160 kB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... ^M(Reading database ... 5%^M(Reading database ... 10%^M(Reading database ... 15%^M(Reading database ... 20%^M(Reading database ... 25%^M(Reading database $
Preparing to unpack .../nodejs_10.15.2~dfsg-2_i386.deb ...
Unpacking nodejs (10.15.2~dfsg-2) ...
Setting up nodejs (10.15.2~dfsg-2) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Processing triggers for man-db (2.8.5-2) ...

What do I wrong, The Raspberry desktop is a clean install on VmWare.

The script is meant for running on a real Pi or 64bit architecture - there is no longer a decent build for nodejs on 32 bit x86 architecture - so you will need to install nodejs by hand first (to not use the built in deb package), and then use the script to add Node-RED . Or use an Ubuntu VM

@dceejay, thanks for responding. Is the Raspberry PI Desktop not 64 bit?

Could you help me a bit with installing this as my Linux experience is very low :frowning: Just learning...)

Thanks

The suggestion is that your computer is 32 bit.

It isn't it is 64 bit.

Have you installed a 32 bit version of Debian then?

@Colin, I have installed this one: https://www.raspberrypi.org/downloads/raspberry-pi-desktop/

Oh, you said you had installed the desktop on Debian, what you mean is that you have installed Raspbian Buster.
What does this command show?
apt policy nodejs

nodejs:
  Installed: 10.15.2~dfsg-2
  Candidate: 10.15.2~dfsg-2
  Version table:
 *** 10.15.2~dfsg-2 500
        500 http://ftp.debian.org/debian buster/main i386 Packages
        100 /var/lib/dpkg/status

What do these commands show?
node -v
npm -v
If either of those shows an error then can you post the full install log please?

@Colin

pi@raspberry:~ $ node -v
v10.15.2
pi@raspberry:~ $ npm -v
bash: npm: command not found
pi@raspberry:~ $ 

As I asked please

@Colin, Aha sorry, I misunderstood you.

Sorry for the long text, but new users are not able to load attachments :frowning:

***************************************

Started : Thu 23 Apr 2020 10:56:59 AM CEST
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...
E: Unable to locate package nodered
Already have nodejs v10.15.2
Now install nodejs
Updating nodejs v10.15.2
Using nodesource.list
Removing nodejs v10

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
The following packages were automatically installed and are no longer required:
  libc-ares2 libnode64 libuv1 nodejs-doc
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  nodejs
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 160 kB disk space will be freed.
(Reading database ... 143192 files and directories currently installed.)
Removing nodejs (10.15.2~dfsg-2) ...
Processing triggers for man-db (2.8.5-2) ...

## Installing the NodeSource Node.js 12.x repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 http://ftp.debian.org/debian buster InRelease
Hit:2 http://ftp.debian.org/debian buster-updates InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Hit:4 https://deb.nodesource.com/node_12.x buster InRelease
Hit:5 http://security.debian.org buster/updates InRelease
Reading package lists...

## Confirming "buster" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_12.x/dists/buster/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
Warning: apt-key output should not be parsed (stdout is not a terminal)
OK

## Creating apt sources list file for the NodeSource Node.js 12.x repo...

+ echo 'deb https://deb.nodesource.com/node_12.x buster main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_12.x buster main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 http://security.debian.org buster/updates InRelease
Hit:2 http://ftp.debian.org/debian buster InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Hit:4 http://ftp.debian.org/debian buster-updates InRelease
Hit:5 https://deb.nodesource.com/node_12.x buster InRelease
Reading package lists...

## Run `sudo apt-get install -y nodejs` to install Node.js 12.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/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn



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

Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  npm
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/86.3 kB of archives.
After this operation, 160 kB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 143181 files and directories currently installed.)
Preparing to unpack .../nodejs_10.15.2~dfsg-2_i386.deb ...
Unpacking nodejs (10.15.2~dfsg-2) ...
Setting up nodejs (10.15.2~dfsg-2) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Processing triggers for man-db (2.8.5-2) ...

I much prefer a paste inline to having to open a link.
Very odd, it isn't installing nodejs 12 for some reason. What do these show?

cat /etc/apt/sources.list.d/nodesource.list
sudo apt update
apt policy nodejs

I think it might be something to do with the VM you are installing into, but I don't know enough about VMs to suggest what.

Not much help but I had an old stretch version of RPi for Desktop in VirtualBox vm so I gave the script a go on that and it failed on me as well - different error messages (stuff about nvm) but fail just the same

Maybe just use an 64bit Ubunutu VM like what @dceejay recommended if you want to try out NR on a VM?

Looking back I see that the nodejs install script has setup the repository
http://ftp.debian.org/debian buster/main i386 Packages
which is a 32 bit repository as was pointed out earlier. I think the nodejs install script (which is not provided by node red) is not handling Raspbian on a Debian VM correctly.

To clarify - Raspbian is still a 32 bit operating system - whether for arm or intel processor. (As Pi doesn't yet go above 4GB there is no need for 64 bit.. :slight_smile: So if you create a vm on a 64bit machine the vm will still be 32bit. No doubt that will change at some point - but that is not where we are.

You could try an unofficial build from here - https://unofficial-builds.nodejs.org/download/release/v12.16.2/
or go way back to node8 official build - https://nodejs.org/dist/latest-carbon/node-v8.17.0-linux-x86.tar.gz

As I said it's probably cleaner to go for an ubuntu vm on intel instead. Or there is another Debian based distro called Zoriin which has quite a nice UI.

Hi Guys,
I am pretty sure it is 64 bit. But I think indeed the script does not detect this very well.

pi@raspberry:~ $ uname -m
x86_64

I will try zoriin see if that is helping :slight_smile:

A solution is not to use the install script, but to install the individual components by hand. I think this is detailed in the getting started guide. It is not particularly difficult.

Hi @Colin, ok I will check this as well. Thanks!