Cannot install Node-Red on VM

Having issues with your DietPi installation, or, found a bug? Post it here.
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Re: Cannot install Node-Red on VM

Post by baz123 »

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/distribut ... 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.
User avatar
Joulinar
Posts: 2566
Joined: Sat Nov 16, 2019 12:49 am

Re: Cannot install Node-Red on VM

Post by Joulinar »

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.

Code: Select all

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

Code: Select all

[  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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
baz123
Posts: 166
Joined: Thu Jan 12, 2017 9:23 pm

Re: Cannot install Node-Red on VM

Post by baz123 »

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

Code: Select all

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
Post Reply