Installation Error

Hello Good peoples,

Just tried to install an instance of node-red on Debian 12 under proxmox
I have done this a heap of times and never any problems

However I get

root@debian:/etc# node-red
Illegal instruction (core dumped)

Installation was

  1. install npm with apt-get
  2. Install node-red with npm
    root@debian:/etc# npm install node-red
    added 312 packages in 38s

Is the current installation broken or is something else?

Any help appreciated

Did you install nodejs? Which version?

What do these command show?

node -v
npm -v

I don't know about proxmox. Are you not able to use the usual Debian/pi install script?

Hi Thanks for the replying
root@debian:~# node -v
v18.19.0

root@debian:~# npm -v
9.2.0

Ive never used the debian/pi install script before?

It seems npm installs everything without any errors

Im really at a loss... ive put node-red on proxmox before without issues, however this is on a AMD turion on a HP N54L which I wouldnt of thought would make a difference.

The install script provides multiple benefits.

but you are running node-red from the etc directory, that is not really the way to do this, as it reads/writes various files when starting in the .node-red dir, which should live in a user dir, ie. node-red is a global module that can be instantiated.

As per documentation, or using the script

1 Like

Thanks.
Removed node-red with npm --uninstall
run the script
completed installation
Result.... Illegal instruction (core dumped)

doesn't node-red use the home directory of the user to create the .node-red directory? I.e. ~/.node-dir is created/used regardless of the directory the user starts node-red.

Yeah that could be, but OP is running this as root, he may not have a homedir.

@leftymuller you ran the script as a user, not root ?

root has the /root directory as home

@bakman2 ran as a normal user

Sounds like an architecture issue - are you running it as a lxc or vm ? possibly it needs certain architecture flags enabled in the proxmox vm settings (if using vm).

"Illegal instruction" is usually more down to some hardware/os/architecture mismatch eg running intel code on an arm processor, or 64bit code on 32 bit architecture, or incompatible libc libraries eg debian vs alpine etc

1 Like

@bakman2
running it as a VM

I did notice that when I installed it via npm for an instant it said "blah blah-android-arm64"

I even tried npm --install --cpu x64 but it didnt make any difference

sounds like you have the incorrect base VM then... what does uname -a and/or cat /etc/issue return ?

Linux debian 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux

This is inside the guest vm ?... If so that looks ok - so I've no idea where that Android reference came from... but that is the issue.. need to totally remove nodejs and npm and somehow get the correct (x86_64) ones installed... (which the install script should do)

(###############â ‚â ‚â ‚) â ™ reify:@node-rs/bcrypt-android-arm-eabi: timing reifyNode:node_modules/@node-rs/bcrypt-android-arm64 Completed in 31ms

managed to capture it

Something weird here gents

root@debian:/usr/local/lib/node_modules/node-red# js red.js
Illegal instruction (core dumped)

but when i run

.load red.js
it Lists contents of red.js with error

                                                              return;
                                                              ^^^^^^

Uncaught SyntaxError: Illegal return statement

On the face of it, something is wrong either with your installation of Node.js or Node-red or else at a lower level of the OS.

And it seems that you have installed it without using the "official" script, as the user root and from the directory /etc.
I think it's unlikely anyone else will be able to diagnose the precise issue.

Is it practical to start again with a clean OS?
Try using the install script, from the home directory of a non-privileged user account (though they should be able to use sudo).
I don't know if this is possible with Proxmox.

Don't run the install script with sudo.

Thanks @Colin. I should have been more explicit.

The script should be run as a non privileged user, though it will prompt for the sudo password as necessary.