Cannot install Node-Red on VM

During install the following error is seen.

[  OK  ] DietPi-Software | G_AGI python python3
/DietPi/dietpi/dietpi-software: line 2914:  2426 Illegal instruction     npm i -g --unsafe-perm node-red

Using the VM image.

Hi,

I was testing the installation of node-red on my VM as well without issues. Are you able to retry?

Nope, same error.

 Mode: Installing Node-Red: tool for wiring devices, APIs and online services

[ INFO ] DietPi-Software | APT installation for: python python3, please wait...
[  OK  ] DietPi-Software | G_AGI python python3
/DietPi/dietpi/dietpi-software: line 2914: 17865 Illegal instruction     npm i -g --unsafe-perm node-red
[ SUB1 ] DietPi-Services > stop
[  OK  ] DietPi-Services | stop : cron
[  OK  ] DietPi-Services | stop : netdata
[  OK  ] DietPi-Services | stop : mosquitto
[  OK  ] DietPi-Services | stop : avahi-daemon

I have tried uninstalling and reinstalling.

can you maybe create an empty / fresh VM and check how it is there? You could one of the new VM Images.

This is an almost fresh image (just a few packages added) running

DietPi v6.28.0

root@DietPi:~#  cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

What is ‘new’? It is a PITA to convert the VMWare to an ESXI image so unless there is a good reason to, I’d rather not update the base image.

hmm it might be that this is because you are running on ESXI server. Looks like your hardware/cpu architecture is not supported and you get the

Illegal instruction

message. Did you checked the option to install Node-Red on Docker?

https://nodered.org/docs/getting-started/docker

In which case DietPi should mark as unavailable?

Thing is, it used to work fine. Only when I updated to Buster images did it complain.

The server is just an AMD Turion Neo N54L.

Hi,

DietPi is doing nothing else as executing the commands that are listed on Node-Red WebSite.

https://nodered.org/docs/getting-started/local

npm install -g --unsafe-perm node-red

So you could execute it yourselves. But this exactly the point where your installation failed

Illegal instruction     npm i -g --unsafe-perm node-red

Yes that is exactly where it failed. I tried it manually without success. There was some stuff on-line regarding an issue with Proxies (I’m not behind one) and I tried some of the fixes but I have not been able to solve the issue. Very annoying. I like DietPi but it seems that for me (with the HDD/SSD issue as well) it is time to part ways.

:sunglasses:

I don’t think this is a DietPi problem. But maybe you could try a different Debian Destro on your ESXI server.

I’ve eventually got Node-Red installed by installing nodejs V12 first manually and then Node-Red by the command above

I note from the node-red pages https://nodered.org/docs/faq/node-versions that nodejs V12 is the highest supported version where DietPi installs V13.

[edit]
I have now tested this further and it is definitely the version of nodejs that is the issue.

I first installed nodejs v12 manually from the debian repos - as per https://github.com/nodesource/distributions/blob/master/README.md#debinstall

I then edited dietpi-software so that the nodejs install script does not run but DietPi think it has installed nodejs.

Running dietpi-software install 122, runs as expected and installs Node-Red.

Hi,

DietPi is not calling a specific version of Node.js. It’s using the default installer, that is provided by Node.js. And this installer is downloading Node.js. So it’s out of DietPi control which version is downloaded.

DietPi-Software
─────────────────────────────────────────────────────
 Mode: Installing Node.js: javascript runtime

[  OK  ] DietPi-Software | Connection test: https://raw.githubusercontent.com/taaem/nodejs-linux-installer/master/node-install.sh
--2020-03-03 16:17:02--  https://raw.githubusercontent.com/taaem/nodejs-linux-installer/master/node-install.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.64.133, 151.101.0.133, 151.101.192.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.64.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1943 (1.9K) [text/plain]
Saving to: ‘node-install.sh’

node-install.sh               100%[==============================================>]   1.90K  --.-KB/s    in 0s

2020-03-03 16:17:03 (14.8 MB/s) - ‘node-install.sh’ saved [1943/1943]

Node Linux Installer by www.github.com/taaem
Running as Root User
Get Latest Version Number...
Done
Downloading latest stable Version node-v13.9.0-linux-x64.tar.gz...
Done
Installing...
Finished installing!

I tested it again on my VM and it’s still working fine using node-v13

[  OK  ] DietPi-Software | G_AGI python python3
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
/usr/local/bin/node-red -> /usr/local/lib/node_modules/node-red/red.js
/usr/local/bin/node-red-pi -> /usr/local/lib/node_modules/node-red/bin/node-red-pi

> bcrypt@3.0.6 install /usr/local/lib/node_modules/node-red/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v79-linux-x64-glibc.tar.gz
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@13.9.0 (node-v79 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/usr/local/lib/node_modules/node-red/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
In file included from ../src/bcrypt_node.cc:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2232:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
In file included from ../../nan/nan.h:53,
                 from ../src/bcrypt_node.cc:1:
../src/bcrypt_node.cc: At global scope:
/root/.cache/node-gyp/13.9.0/include/node/node.h:618:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/root/.cache/node-gyp/13.9.0/include/node/node.h:652:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/bcrypt_node.cc:378:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(bcrypt_lib, init);
 ^~~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
  COPY /usr/local/lib/node_modules/node-red/node_modules/bcrypt/lib/binding/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/usr/local/lib/node_modules/node-red/node_modules/bcrypt/build'
+ node-red@1.0.4
added 334 packages from 340 contributors in 81.657s

The node-red docs state V12 is the latest supported version of nodejs. https://nodered.org/docs/faq/node-versions

The Node-Red Raspbian install script installs v12 (or v8 depending on base OS).

OV=`cat /etc/os-release | grep VERSION_ID | cut -d '"' -f 2`
if [[ "$OV" = "8" ]]; then
    if curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - 2>&1 | sudo tee -a /var/log/nodered-install.log >>/dev/null; then CHAR=$TICK; else CHAR=$CROSS; fi
else
    if curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - 2>&1 | sudo tee -a /var/log/nodered-install.log >>/dev/null; then CHAR=$TICK; else CHAR=$CROSS; fi
fi

As V13 is not a supported version of nodejs by Node-Red, it should not be used.

Issue https://github.com/MichaIng/DietPi/issues/3408