Code Monkey home page Code Monkey logo

linux-installers's Introduction

Node-RED

https://nodered.org

Build Status

Low-code programming for event-driven applications.

Node-RED: Low-code programming for event-driven applications

Quick Start

Check out https://nodered.org/docs/getting-started/ for full instructions on getting started.

  1. sudo npm install -g --unsafe-perm node-red
  2. node-red
  3. Open http://localhost:1880

Getting Help

More documentation can be found here.

For further help, or general discussion, please use the Node-RED Forum or slack team.

Developers

If you want to run the latest code from git, here's how to get started:

  1. Clone the code:

     git clone https://github.com/node-red/node-red.git
     cd node-red
    
  2. Install the node-red dependencies

     npm install
    
  3. Build the code

     npm run build
    
  4. Run

     npm start
    

Contributing

Before raising a pull-request, please read our contributing guide.

This project adheres to the Contributor Covenant 1.4. By participating, you are expected to uphold this code. Please report unacceptable behavior to any of the project's core team at [email protected].

Authors

Node-RED is a project of the OpenJS Foundation.

It is maintained by:

Copyright and license

Copyright OpenJS Foundation and other contributors, https://openjsf.org under the Apache 2.0 license.

linux-installers's People

Contributors

dceejay avatar dgoo2308 avatar kevinrohn avatar m10k avatar natcl avatar nmaupu avatar ralphwetzel avatar recursivecodes avatar sipper1236 avatar steve-mcl avatar trentinc avatar zhan-kunbus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linux-installers's Issues

Installer bash script fails to install node-red V3.0.0

when running the bash script on a Pi, the install fails (https://discourse.nodered.org/t/node-red-v3-0-0-pi-installer-script-node-red-does-not-start-after-installer-is-finished-setting-js-no-such-file-or-directory/65085/4)

However if you use sudo npm install -g --unsafe-perm node-red it does install

This is the nstall log using the bash script:
pi@testpi:~ $ cat /var/log/nodered-install.log
Already have nodejs v14.20.0
OLD nodejs 14 :
NEW nodejs :


Started : Thu 14 Jul 2022 06:59:41 AM EDT
Running for user pi at /home/pi
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
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Versions: node:v14.20.0 npm:6.14.17
Now install Node-RED
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN [email protected] requires a peer of socket.io@2 || 3 || 4 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of node-red-dashboard@^2.26.1 but none is installed. You must install peer dependencies yourself.
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

  • [email protected]
    updated 1 package in 15.789s
    3.0.0
    Now create basic package.json for the user and move any global nodes
    Installing extra nodes: node-red-node-pi-gpio@latest node-red-node-random@latest node-red-node-ping@latest node-red-contrib-play-audio@latest node-red-node-smooth@latest node-red-node-serialport@latest :
    npm WARN [email protected] requires a peer of expo@* but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of node-red-dashboard@^2.26.1 but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.

  • [email protected]

  • [email protected]

  • [email protected]

  • [email protected]

  • [email protected]

  • [email protected]
    updated 6 packages in 28.993s
    Now add the shortcut and start/stop/log scripts to the menu
    Now add systemd script and configure it for pi:pi @ /home/pi
    ln: failed to create symbolic link '/usr/bin/python': File exists
    Now add launcher to top bar, add cpu temp example, make sure ping works
    The user pi' is already a member of gpio'.

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

Reading package lists...
Building dependency tree...
Reading state information...
python3-rpi.gpio is already the newest version (0.7.0-0.1bpo10+4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Memory : 971M
Started : Thu 14 Jul 2022 06:59:41 AM EDT
Finished: Thu 14 Jul 2022 07:01:00 AM EDT
pi@testpi:
$

Came across this today? Looks like the install script needs a slight tweak?

Running Node-RED install for user pi at /home/pi on debian

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 ✔
Install Node.js 16 LTS ✔ v16.16.0 Npm 8.11.0
Clean npm cache ✔
npm WARN config global --global, --local are deprecated. Use --location=global instead.
Install Node-RED core ✔ 3.0.0
Move global nodes to local -
Npm rebuild existing nodes ✔
Install extra Pi nodes ✔
Add shortcut commands ✔
Update systemd script ✔

Any errors will be logged to /var/log/nodered-install.log

All done.
You can now start Node-RED with the command node-red-start
or using the icon under Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started : Mon 18 Jul 2022 08:47:19 PM UTC
Finished: Mon 18 Jul 2022 08:54:06 PM UTC

You may want to run node-red admin init
to configure your initial options and settings.

Remove Python2 dependencies

I've running latest raspberry pi os, installed nodered by apt, then found that is needed Python2.

Linux pi 5.4.83-v7+ node-red/node-red#1379 SMP Mon Dec 14 13:08:57 GMT 2020 armv7l GNU/Linux

This are the packages that requires python2:


  libbrotli1 libc-ares2 libjs-inherits libjs-is-typedarray libnode-dev libnode64 libpython-stdlib libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib libssl-dev libuv1 libuv1-dev node-abbrev
  node-ajv node-ansi node-ansi-align node-ansi-regex node-ansi-styles node-ansistyles node-aproba node-archy node-are-we-there-yet node-asn1 node-assert-plus node-asynckit node-aws-sign2 node-aws4
  node-balanced-match node-bcrypt-pbkdf node-bluebird node-boxen node-brace-expansion node-builtin-modules node-builtins node-cacache node-call-limit node-camelcase node-caseless node-chalk
  node-chownr node-cli-boxes node-cliui node-clone node-co node-color-convert node-color-name node-combined-stream node-concat-map node-concat-stream node-config-chain node-console-control-strings
  node-copy-concurrently node-core-util-is node-cross-spawn node-cyclist node-dashdash node-decamelize node-decompress-response node-deep-extend node-defaults node-delayed-stream node-delegates
  node-detect-indent node-detect-newline node-duplexer3 node-duplexify node-ecc-jsbn node-editor node-encoding node-end-of-stream node-errno node-escape-string-regexp node-execa node-extend
  node-extsprintf node-find-up node-flush-write-stream node-forever-agent node-form-data node-from2 node-fs-vacuum node-fs-write-stream-atomic node-fs.realpath node-gauge node-get-caller-file
  node-get-stream node-getpass node-glob node-got node-graceful-fs node-har-schema node-har-validator node-has-flag node-has-symbol-support-x node-has-to-string-tag-x node-has-unicode
  node-hosted-git-info node-http-signature node-iconv-lite node-iferr node-import-lazy node-imurmurhash node-inflight node-inherits node-ini node-invert-kv node-is-builtin-module node-is-npm
  node-is-object node-is-plain-obj node-is-retry-allowed node-is-stream node-is-typedarray node-isarray node-isexe node-isstream node-isurl node-jsbn node-json-parse-better-errors node-json-schema
  node-json-stable-stringify node-json-stringify-safe node-jsonify node-jsonparse node-jsonstream node-jsprim node-latest-version node-lazy-property node-lcid node-libnpx node-locate-path
  node-lockfile node-lowercase-keys node-lru-cache node-mem node-mime-types node-mimic-fn node-mimic-response node-minimatch node-minimist node-mississippi node-mkdirp node-move-concurrently
  node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npm-package-arg node-npm-run-path node-npmlog node-oauth-sign node-object-assign node-once node-opener node-os-locale
  node-osenv node-p-cancelable node-p-finally node-p-limit node-p-locate node-p-timeout node-package-json node-parallel-transform node-path-exists node-path-is-absolute node-path-is-inside
  node-performance-now node-prepend-http node-process-nextick-args node-promise-inflight node-promzard node-proto-list node-prr node-pump node-pumpify node-punycode node-qs node-qw node-rc node-read
  node-read-package-json node-readable-stream node-registry-auth-token node-registry-url node-request node-require-directory node-require-main-filename node-resolve-from node-retry node-rimraf
  node-run-queue node-safe-buffer node-semver node-semver-diff node-set-blocking node-sha node-shebang-command node-shebang-regex node-signal-exit node-slash node-slide node-sorted-object
  node-spdx-correct node-spdx-expression-parse node-spdx-license-ids node-sshpk node-ssri node-stream-each node-stream-iterate node-stream-shift node-string-decoder node-string-width node-strip-ansi
  node-strip-eof node-strip-json-comments node-supports-color node-tar node-term-size node-text-table node-through node-through2 node-timed-out node-tough-cookie node-tunnel-agent node-tweetnacl
  node-typedarray node-uid-number node-unique-filename node-unpipe node-url-parse-lax node-url-to-options node-util-deprecate node-uuid node-validate-npm-package-license
  node-validate-npm-package-name node-verror node-wcwidth.js node-which node-which-module node-wide-align node-widest-line node-wrap-ansi node-wrappy node-write-file-atomic node-xdg-basedir
  node-xtend node-y18n node-yallist node-yargs node-yargs-parser nodejs python-minimal python2-minimal python2.7 python2.7-minimal

Python 2 should be or replaced by 3 https://pythonclock.org/

node-red-start leaks terminal window title

What are the steps to reproduce?

  • Install Node-RED as per this guide
  • Start it from the terminal by executing node-red-start
  • Watch the log as it starts
  • Quit the log view and get back to the shell prompt by pressing Ctrl+C

What happens?

The terminal window title remains "Node-RED console" and doesn't change back again. This makes it a bit harder to distinguish the PuTTY windows on my desktop to find the correct host to work with.

What do you expect to happen?

Either don't change that title at all, or at least change it back to what it was before when leaving the program.

Please tell us about your environment:

  • Node-RED version: v1.3.5
  • Node.js version: v14.17.2
  • npm version: 6.14.13
  • Platform/OS: Raspberry Pi OS, Linux 5.10.17-v7+ arm LE
  • Browser: n/a (PuTTY SSH terminal)

Node-Red not fully installed

I run the install script with this command:
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

It seemed to run successfully, but node-red will not start (see picture below)
image

I am running Ubuntu 18.04 on Windows Subsystem for Linux, and have installed build-essential

Can not run script

I try to run the script on Ubuntu but I get: bash: /dev/fd/63: No such file or directory.
Any solution?

failing to install on GCP VM w/ Debian

hello

i am trying to install on debian 12 (bookwarm) in GCP cloud, using the script from https://nodered.org/docs/getting-started/raspberrypi

script fails to detect that i have sudo rights (I do).

For my VM instances I use native google auth for SSH, meaning i authenticate to VM SSH with my gmail credentials.

what i see in my /etc/sudoers:

@includedir /etc/sudoers.d

next, in /etc/sudoers.d i see:

/etc/sudoers.d$ ls -la
total 20
drwxr-xr-x 2 root root 4096 Feb 29 02:58 .
drwxr-xr-x 77 root root 4096 Mar 2 22:45 ..
-r--r----- 1 root root 1096 Jun 27 2023 README
-r--r----- 1 root root 34 Feb 29 02:58 google-oslogin
-r--r----- 1 root root 43 Feb 29 02:58 google_sudoers

next, i read inside the files:

sudo cat google-oslogin
includedir /var/google-sudoers.d

next, cd /var/google-sudoers.d

/var/google-sudoers.d# ls -la
total 12
drwxr-x--- 2 root root 4096 Feb 29 02:58 .
drwxr-xr-x 13 root root 4096 Feb 29 02:58 ..
-r--r----- 1 root root 52 Feb 29 02:58 myemail_gmail_com

at last, i do 'cat myemail_gmail_com" while in /var/google-sudoers.d and i see:
myemail_gmail_com ALL=(ALL) NOPASSWD: ALL

This is how they integrate google auth into sudo architecture... so if your install scripts checks JUST for the username in sudoers, without doing full recursive check of all includes, it will fail to validate that i have sudo rights

P.S. i have Node21 installed
P.P.S. potentially unrelated, but when i try to run the install with sudo, i get an error "bash: /dev/fd/63: No such file or directory"

THANKS for looking into it

Debian installer not working correctly with bookworm

  • Upgraded Raspberry Pi OS to Debian 12 (bookworm)
  • Used the installer to install NodeRED and nodejs without any parameters
  • Installer plans to install nodejs 16
  • nodejs 18 is installed instead
  • Install fails
Screenshot 2023-06-27 at 09 18 55 Screenshot 2023-06-27 at 09 18 36

System info

pi@smarthomeraspi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm

Log

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

Started : Di 27. Jun 08:38:41 CEST 2023
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.

Paketlisten werden gelesen…
Abhängigkeitsbaum wird aufgebaut…
Statusinformationen werden eingelesen…
E: Paket nodered kann nicht gefunden werden.
Installing nodejs 16

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

Paketlisten werden gelesen…
Abhängigkeitsbaum wird aufgebaut…
Statusinformationen werden eingelesen…
Paket »nodejs-legacy« ist nicht installiert, wird also auch nicht entfernt.
Paket »nodejs« ist nicht installiert, wird also auch nicht entfernt.
Paket »npm« ist nicht installiert, wird also auch nicht entfernt.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
dpkg: Warnung: Die Anforderung, nodejs zu entfernen, wird ignoriert; es ist nicht installiert
dpkg: Warnung: Die Anforderung, node zu entfernen, wird ignoriert; es ist nicht installiert

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

Paketlisten werden gelesen…
Abhängigkeitsbaum wird aufgebaut…
Statusinformationen werden eingelesen…
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Grab the LTS bundle

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

Paketlisten werden gelesen…
Abhängigkeitsbaum wird aufgebaut…
Statusinformationen werden eingelesen…
curl ist schon die neueste Version (7.88.1-10).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

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


## Populating apt-get cache...

+ apt-get update
OK:1 http://security.debian.org/debian-security bookworm-security InRelease
OK:2 http://deb.debian.org/debian bookworm InRelease
OK:3 http://deb.debian.org/debian bookworm-updates InRelease
OK:4 http://archive.raspberrypi.org/debian bookworm InRelease
Paketlisten werden gelesen…

## Confirming "bookworm" is supported...

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

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

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null

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

+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x bookworm main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x bookworm main' >> /etc/apt/sources.list.d/nodesource.list

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

+ apt-get update
OK:1 http://security.debian.org/debian-security bookworm-security InRelease
OK:2 http://deb.debian.org/debian bookworm InRelease
OK:3 http://deb.debian.org/debian bookworm-updates InRelease
OK:4 http://archive.raspberrypi.org/debian bookworm InRelease
Holen:5 https://deb.nodesource.com/node_16.x bookworm InRelease [4.586 B]
Holen:6 https://deb.nodesource.com/node_16.x bookworm/main armhf Packages [785 B]
Holen:7 https://deb.nodesource.com/node_16.x bookworm/main arm64 Packages [778 B]
Es wurden 6.149 B in 2 s geholt (3.869 B/s).
Paketlisten werden gelesen…

## Run `sudo apt-get install -y nodejs` to install Node.js 16.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 | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
     echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] 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.

Paketlisten werden gelesen…
Abhängigkeitsbaum wird aufgebaut…
Statusinformationen werden eingelesen…
Die folgenden zusätzlichen Pakete werden installiert:
  libc-ares2 libnode108 libuv1 node-acorn node-busboy node-cjs-module-lexer
  node-undici node-xtend nodejs-doc
Vorgeschlagene Pakete:
  npm
Die folgenden NEUEN Pakete werden installiert:
  libc-ares2 libnode108 libuv1 node-acorn node-busboy node-cjs-module-lexer
  node-undici node-xtend nodejs nodejs-doc
0 aktualisiert, 10 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen 13,7 MB an Archiven heruntergeladen werden.
Nach dieser Operation werden 64,7 MB Plattenplatz zusätzlich benutzt.
Holen:1 http://deb.debian.org/debian bookworm/main arm64 libc-ares2 arm64 1.18.1-3 [99,2 kB]
Holen:2 http://deb.debian.org/debian bookworm/main arm64 libuv1 arm64 1.44.2-1 [133 kB]
Holen:3 http://deb.debian.org/debian bookworm/main arm64 node-xtend all 4.0.2-3 [3.932 B]
Holen:4 http://deb.debian.org/debian bookworm/main arm64 nodejs arm64 18.13.0+dfsg1-1 [304 kB]
Holen:5 http://deb.debian.org/debian bookworm/main arm64 node-acorn all 8.8.1+ds+~cs25.17.7-2 [128 kB]
Holen:6 http://deb.debian.org/debian bookworm/main arm64 node-cjs-module-lexer all 1.2.2+dfsg-5 [30,1 kB]
Holen:7 http://deb.debian.org/debian bookworm/main arm64 node-busboy all 1.6.0+~cs2.6.0-2 [16,9 kB]
Holen:8 http://deb.debian.org/debian bookworm/main arm64 node-undici all 5.15.0+dfsg1+~cs20.10.9.3-1 [283 kB]
Holen:9 http://deb.debian.org/debian bookworm/main arm64 libnode108 arm64 18.13.0+dfsg1-1 [9.366 kB]
Holen:10 http://deb.debian.org/debian bookworm/main arm64 nodejs-doc all 18.13.0+dfsg1-1 [3.358 kB]
Es wurden 13,7 MB in 1 s geholt (11,0 MB/s).
Vormals nicht ausgewähltes Paket libc-ares2:arm64 wird gewählt.
(Lese Datenbank ... 41930 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../0-libc-ares2_1.18.1-3_arm64.deb ...
Entpacken von libc-ares2:arm64 (1.18.1-3) ...
Vormals nicht ausgewähltes Paket libuv1:arm64 wird gewählt.
Vorbereitung zum Entpacken von .../1-libuv1_1.44.2-1_arm64.deb ...
Entpacken von libuv1:arm64 (1.44.2-1) ...
Vormals nicht ausgewähltes Paket node-xtend wird gewählt.
Vorbereitung zum Entpacken von .../2-node-xtend_4.0.2-3_all.deb ...
Entpacken von node-xtend (4.0.2-3) ...
Vormals nicht ausgewähltes Paket nodejs wird gewählt.
Vorbereitung zum Entpacken von .../3-nodejs_18.13.0+dfsg1-1_arm64.deb ...
Entpacken von nodejs (18.13.0+dfsg1-1) ...
Vormals nicht ausgewähltes Paket node-acorn wird gewählt.
Vorbereitung zum Entpacken von .../4-node-acorn_8.8.1+ds+~cs25.17.7-2_all.deb ...
Entpacken von node-acorn (8.8.1+ds+~cs25.17.7-2) ...
Vormals nicht ausgewähltes Paket node-cjs-module-lexer wird gewählt.
Vorbereitung zum Entpacken von .../5-node-cjs-module-lexer_1.2.2+dfsg-5_all.deb ...
Entpacken von node-cjs-module-lexer (1.2.2+dfsg-5) ...
Vormals nicht ausgewähltes Paket node-busboy wird gewählt.
Vorbereitung zum Entpacken von .../6-node-busboy_1.6.0+~cs2.6.0-2_all.deb ...
Entpacken von node-busboy (1.6.0+~cs2.6.0-2) ...
Vormals nicht ausgewähltes Paket node-undici wird gewählt.
Vorbereitung zum Entpacken von .../7-node-undici_5.15.0+dfsg1+~cs20.10.9.3-1_all.deb ...
Entpacken von node-undici (5.15.0+dfsg1+~cs20.10.9.3-1) ...
Vormals nicht ausgewähltes Paket libnode108:arm64 wird gewählt.
Vorbereitung zum Entpacken von .../8-libnode108_18.13.0+dfsg1-1_arm64.deb ...
Entpacken von libnode108:arm64 (18.13.0+dfsg1-1) ...
Vormals nicht ausgewähltes Paket nodejs-doc wird gewählt.
Vorbereitung zum Entpacken von .../9-nodejs-doc_18.13.0+dfsg1-1_all.deb ...
Entpacken von nodejs-doc (18.13.0+dfsg1-1) ...
node-cjs-module-lexer (1.2.2+dfsg-5) wird eingerichtet ...
libc-ares2:arm64 (1.18.1-3) wird eingerichtet ...
libuv1:arm64 (1.44.2-1) wird eingerichtet ...
nodejs-doc (18.13.0+dfsg1-1) wird eingerichtet ...
node-xtend (4.0.2-3) wird eingerichtet ...
node-busboy (1.6.0+~cs2.6.0-2) wird eingerichtet ...
node-undici (5.15.0+dfsg1+~cs20.10.9.3-1) wird eingerichtet ...
node-acorn (8.8.1+ds+~cs25.17.7-2) wird eingerichtet ...
libnode108:arm64 (18.13.0+dfsg1-1) wird eingerichtet ...
nodejs (18.13.0+dfsg1-1) wird eingerichtet ...
update-alternatives: /usr/bin/nodejs wird verwendet, um /usr/bin/js (js) im automatischen Modus bereitzustellen
Trigger für man-db (2.11.2-2) werden verarbeitet ...
Trigger für libc-bin (2.36-9) werden verarbeitet ...

Versions: node:v18.13.0 npm:missing
Already have nodejs v18.13.0
OLD nodejs 18 :
NEW nodejs 18 :

Install fails on AlmaLinux 8.4

Trying to install nodered on Almalinux and get the following error:

Doesn't seem to be running on RedHat, Centos, Fedora, or Oracle Linux, so quitting

I tried removing the symlink from /etc/centos-release to /etc/almalinux-release and recreating the files with the CentOS and or Red Hat release info. Still didn't work.

Is this resolved in version 16?

option --nodered-user is broken

Hi!
Using the script on a Debian system executing it as root and specifying the user to run as with option --nodered-user=xxxxx leads to the following error and stop of script (at least I cannot see whether or not the script got interrupted by the error or it actually finished the installation).
During the installation process the path to the settings file was given as:

/home/nodered/.node-red/settings.js

Resulting error:

Settings file written to /home/nodered/.node-red/settings.js
chown: cannot access '/root/.node-red/settings.js': No such file or directory

To me it seems the user input is not used in all necessary places, like the chown operation.
Cheers

Edit: from checking the currently running processes I can see that node-red is not running at the end of the script.

Script fails if sudo is last entry in group list

Commit 7a61394 introduced a bug that would cause the script execution to fail on some systems if sudo is the last entry in the group list of the respective user

See my comment here:
#r138923544

Two of my systems running Debian 11 (grep 3.6) and 12 (grep 3.8) are affected by this, while another running Manjaro (grep 3.11) is not.

The following regex

^.*\bsudo\b.*

seems to work better on my systems.
Not an expert on regexes though, so take it with a grain of salt.

sed: can't read /lib/systemd/system/nodered.service.temp: No such file or directory

I intall the nodered in debian 11.7.0 x64,but the installer report this:


bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)


This script checks the version of node.js installed is 14 or greater. It will try to
install node 16 if none is found. It can optionally install node 12, 14, 16 or 18 LTS for you.

If necessary it will then remove the old core of Node-RED, before then installing the latest
version. You can also optionally specify the version required.

It also tries to run 'npm rebuild' to refresh any extra nodes you have installed
that may have a native binary component. While this normally works ok, you need
to check that it succeeds for your combination of installed nodes.

To do all this it runs commands as root - please satisfy yourself that this will
not damage your Pi, or otherwise compromise your configuration.
If in doubt please backup your SD card first.

See the optional parameters by re-running this command with --help

Are you really sure you want to do this ? [y/N] ? y

Would you like to install the Pi-specific nodes ? [y/N] ? n

Running Node-RED update for user via at /home/via on debian


This can take 20-30 minutes on the slower Pi versions - please wait.

  Stop Node-RED                       ✔
  Remove old version of Node-RED      ✔
  Node option not specified           :   --node14, --node16, or --node18
  Leave existing Node.js              :   v16.20.0   Npm 8.19.4
  Clean npm cache                     -
  Install Node-RED core               ✔   3.0.2
  Move global nodes to local          -
  Leave existing nodes                -
  Install extra Pi nodes              -
  Add shortcut commands               ✘
sed: can't read /lib/systemd/system/nodered.service.temp: No such file or directory
sed: can't read /lib/systemd/system/nodered.service.temp: No such file or directory
mv: cannot stat '/lib/systemd/system/nodered.service.temp': No such file or directory
  Update systemd script               ✔/nodered-install.log



All done.
You can now start Node-RED with the command  node-red-start
  or using the icon under   Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started :  Thu 11 May 2023 08:29:20 PM CST
Finished:  Thu 11 May 2023 08:31:44 PM CST

**********************************************************************************
 ### WARNING ###
 DO NOT EXPOSE NODE-RED TO THE OPEN INTERNET WITHOUT SECURING IT FIRST

 Even if your Node-RED doesn't have anything valuable, (automated) attacks will
 happen and could provide a foothold in your local network

 Follow the guide at https://nodered.org/docs/user-guide/runtime/securing-node-red
 to setup security.

 ### ADDITIONAL RECOMMENDATIONS ###
  - You can customise the initial settings by running:

      node-red admin init

  - After running Node-RED for the first time, change the ownership of the settings
    file to 'root' to prevent unauthorised changes:

      sudo chown root:root ~/.node-red/settings.js

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

  Would you like to customise the settings now (y/N) ? n
Settings not initialized.

and the log file is:

Already have nodejs v16.20.0
OLD nodejs 16 :
NEW nodejs  :

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

Started : Thu 11 May 2023 08:29:20 PM CST
Running for user via at /home/via
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

Versions: node:v16.20.0 npm:8.19.4
Now install Node-RED

added 292 packages in 2m
3.0.2
Now create basic package.json for the user and move any global nodes
Now add the shortcut and start/stop/log scripts to the menu
Now add systemd script and configure it for via:via @ /home/via
ln: failed to create symbolic link '/usr/bin/python': File exists
Now add launcher to top bar, add cpu temp example, make sure ping works
Allow binding to low ports : n
Memory  : 4.7G
Started :  Thu 11 May 2023 08:29:20 PM CST
Finished:  Thu 11 May 2023 08:31:44 PM CST

"No need for sudo" is misleading

Hi,

I have been trying to install node-red as a 'system' user - with uid node-red, rather than my personal user.

When running as root, you get presented a message saying:

Root user detected. Typically install as a normal user. No need for sudo.

Are you really sure you want to install as root ? (y/N) ? 

But then when running as the user node-red, I get the message:

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for node-red: 

I think the message means you don't have to run node-red command with sudo but that isn't very clear.

Running on a Pi-Zero - issues overcome so far and still remaining...

First issue that I ran into was that Node js has been deprecated on the ARM6 Pi-Zero architecture.

I found this post about installing the 'experimental' versions.
https://github.com/sdesalas/node-pi-zero/tree/master

Now when I run the node-red installer it seems to run but I do not end up with a node-red or a node-red-pi executable in my /usr/bin directory.

ls /usr/bin/node*
/usr/bin/node          /usr/bin/node-red-reload   /usr/bin/node-red-start
/usr/bin/node-red-log  /usr/bin/node-red-restart  /usr/bin/node-red-stop

There were no ominous warnings in the log file and the only visual from the installer was the final two lines of output

Running Node-RED install for user me at /home/me on raspbian


This can take 20-30 minutes on the slower Pi versions - please wait.

  Stop Node-RED                       ✔
  Remove old version of Node-RED      ✔
  Node option not specified           :   --node18 or --node20
  Leave existing Node.js              :   v20.11.1   Npm 10.2.4
  Clean npm cache                     -
  Install Node-RED core               ✔   4.0.2
  Move global nodes to local          -
  Leave existing nodes                -
  Install extra Pi nodes              ✔
  Add shortcut commands               ✔
  Update systemd script               ✔


Any errors will be logged to   /var/log/nodered-install.log
All done.
You can now start Node-RED with the command  node-red-start
  or using the icon under   Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started :  Mon  8 Jul 09:36:43 EDT 2024
Finished:  Mon  8 Jul 09:48:40 EDT 2024

**********************************************************************************
 ### WARNING ###
 DO NOT EXPOSE NODE-RED TO THE OPEN INTERNET WITHOUT SECURING IT FIRST

 Even if your Node-RED doesn't have anything valuable, (automated) attacks will
 happen and could provide a foothold in your local network

 Follow the guide at https://nodered.org/docs/user-guide/runtime/securing-node-red
 to setup security.

 ### ADDITIONAL RECOMMENDATIONS ###
  - Remove the /etc/sudoers.d/010_pi-nopasswd file to require entering your password
    when performing any sudo/root commands:

      sudo rm -f /etc/sudoers.d/010_pi-nopasswd

  - You can customise the initial settings by running:

      node-red admin init

  - After running Node-RED for the first time, change the ownership of the settings
    file to 'root' to prevent unauthorised changes:

      sudo chown root:root ~/.node-red/settings.js

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

sudo: /usr/bin/node-red: command not found
chown: cannot access '/home/me/.node-red/settings.js': No such file or directory
 ls -la .node-red
total 32
drwxr-xr-x  3 me me 4096 Jul  8 09:43 .
drwx------  6 me me 4096 Jul  8 09:42 ..
drwxr-xr-x 16 me me 4096 Jul  8 09:43 node_modules
-rw-r--r--  1 me me 448 Jul  8 09:43 package.json
-rw-r--r--  1 me me 13066 Jul  8 09:43 package-lock.json

Install script for Raspberry Pi overwrites custom nodered.service

Hi there!
I used to have node-red 2.1.4 running on a RPi. Installation was done according to the given instruction. I've customized /lib/systemd/system/nodered.service to define some special parameters - e.g. --userDir.

Today I just upgraded this installation - again following the instruction given - to node-red 2.1.5.

After successfull completion of the process I discovered, that my customized /lib/systemd/system/nodered.service was overwritten.

Proposal: Only create nodered.service, if it's missing - but do not overwrite it.
Edge case: If there's a breaking change in nodered.service, that's mandatory to be installed - backup the current file & raise a supportive comment during installation.

Install script for Raspberry Pi may disable/damage some existing nodejs installations

Current Behavior

Preconditions: nodejs has been installed by means other than the Node-RED installer and its bin files linked into /usr/local/bin.

If you run the install script for the Raspberry Pi without any of the options to install a particular version of nodejs, that is, direct it to use an existing installation of nodejs already on the system, the install script will remove the node and npm commands from the system if they are installed in /usr/local/bin, thus damaging the existing nodejs installation. This also then prevents Node-RED from starting successfully when node-red-start is attempted, because it then cannot find node or npm:

image

The deletion of the files occurs at line 338:

sudo rm -rf /usr/local/lib/node_modules/node-red* /usr/local/lib/node_modules/npm /usr/local/bin/node-red* /usr/local/bin/node /usr/local/bin/npm 2>&1 | sudo tee -a /var/log/nodered-install.log >>/dev/null

Expected Behavior

The script should not remove executables that it didn't previously install. It seems to assume that any node and npm files installed in /usr/local/bin are its own from a previous install, but this seems a bit broad.

Steps To Reproduce

Install any version of nodejs using their recommended instructions. After that, link the installed executables into /usr/local/bin. Some systems may do this with their own package installers.

Then run the RPi Node-RED install script per the instructions as shown (with no option to install a particular version of node).

Example flow

N/A

Environment

  • Node-RED version: 2.1.4
  • Node.js version: any
  • npm version: any
  • Platform/OS: *nix
  • Browser: N/A

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

All,
Looking to see how to resolve my issue of not having enough memory in Node. I have large flows hosted on centOS and I have tried changing the memory settings, but that doesn't seem to work.

export NODE_OPTIONS="--max-old-space-size=8192"

Are there any other ways to change these values from the install you put together? Log below

<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xa389b0 node::Abort() [node-red]
2: 0x96e0af node::FatalError(char const*, char const*) [node-red]
3: 0xbb7a4e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node-red]
4: 0xbb7dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node-red]
5: 0xd73fd5 [node-red]
6: 0xd74b5f [node-red]
7: 0xd8299b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node-red]
8: 0xd85e1f v8::internal::Heap::ReserveSpace(std::vector<v8::internal::Heap::Chunk, std::allocatorv8::internal::Heap::Chunk >, std::vector<unsigned long, std::allocator >) [node-red]
9: 0x110a9e2 v8::internal::DeserializerAllocator::ReserveSpace() [node-red]
10: 0x11084e6 v8::internal::ContextDeserializer::Deserialize(v8::internal::Isolate*, v8::internal::Handlev8::internal::JSGlobalProxy, v8::DeserializeInternalFieldsCallback) [node-red]
11: 0x1108d84 v8::internal::ContextDeserializer::DeserializeContext(v8::internal::Isolate*, v8::internal::SnapshotData const*, bool, v8::internal::Handlev8::internal::JSGlobalProxy, v8::DeserializeInternalFieldsCallback) [node-red]
12: 0x112f17a v8::internal::Snapshot::NewContextFromSnapshot(v8::internal::Isolate*, v8::internal::Handlev8::internal::JSGlobalProxy, unsigned long, v8::DeserializeInternalFieldsCallback) [node-red]
13: 0xe30388 v8::internal::Genesis::Genesis(v8::internal::Isolate*, v8::internal::MaybeHandlev8::internal::JSGlobalProxy, v8::Localv8::ObjectTemplate, unsigned long, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*) [node-red]
14: 0xe30738 v8::internal::Bootstrapper::CreateEnvironment(v8::internal::MaybeHandlev8::internal::JSGlobalProxy, v8::Localv8::ObjectTemplate, v8::ExtensionConfiguration*, unsigned long, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*) [node-red]
15: 0xbccf42 v8::NewContext(v8::Isolate*, v8::ExtensionConfiguration*, v8::MaybeLocalv8::ObjectTemplate, v8::MaybeLocalv8::Value, unsigned long, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*) [node-red]
16: 0xbcd694 v8::Context::New(v8::Isolate*, v8::ExtensionConfiguration*, v8::MaybeLocalv8::ObjectTemplate, v8::MaybeLocalv8::Value, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*) [node-red]
17: 0xa2953e node::contextify::ContextifyContext::CreateV8Context(node::Environment*, v8::Localv8::Object, node::contextify::ContextOptions const&) [node-red]
18: 0xa29b45 node::contextify::ContextifyContext::ContextifyContext(node::Environment*, v8::Localv8::Object, node::contextify::ContextOptions const&) [node-red]
19: 0xa29f26 node::contextify::ContextifyContext::MakeContext(v8::FunctionCallbackInfov8::Value const&) [node-red]
20: 0x13ddced [node-red]
Process 1143 (node-red) of user 0 dumped core.
nodered.service: Main process exited, code=dumped, status=6/ABRT
nodered.service: Failed with result 'core-dump'.

Bypass settings file initialisation

I'm using this in a bash script

CONFIRM_ROOT=y CONFIRM_INSTALL=y bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Is it possible to have it skip or automate past this part?

`Node-RED Settings File initialisation

This tool will help you create a Node-RED settings file.

? Settings file ‣ /home/pi/.node-red/settings.js
`

RPI install script wrong flag management

Hi,

I have successfully set up Node-RED as a systemd service on rpi 4 with NVM.
To do so, I used the Node-RED rpi official install script .

After performing a first run of the script, and having noticed that it was not working as expected (IMHO), I checked such a script and found that its $GLOBAL flag seems not set correctly.
In fact, it is initialized to true, and then it should be set to false, since I am using NVM, but this never happens.

So to make the correct installation, I just changed its initial value (I now this is not the correct fix, but the script does a lot of things, and I have no time to check them all).

This leaves the system with a local installation of Node-RED, and a not working systemd init script (nodered.service). But then it is quite easy to make it work (if you are interested to what I have done to make it work, I'll post here the other performed stuff -- basically few simple changes to the nodered.service file).

Nevertheless, the value of the $GLOBAL flag seems incorrect to me, in case of NVM.

Regards

No an issure, but i have no clue.

I installed it with the bash script.
Is there also a script to uninstall ???
I see no --uninstall flag.

The thing is, i want to uninstall it.

Thanks in advance.

update-nodejs-and-nodered messes up filesystem rights when --node16 or --node18 provided on armv6l

Scenario

Trying to update NodeJS to v16 or v18 and Node-Red on a Raspberry Pi Zero W.
Command line given:

update-nodejs-and-nodered --confirm-install --confirm-pi --node18

Expectation

NodeJS and Node-Red is updated without issue. Especially the script should not mess around using root rights.

Observation

The script works fine, when --node14 is provided, but does not work with --node16 or --node18 is provided.

During installation process in the NodeJs state, the filesystem rights in /usr/bin/* are changed from root:root to pi:pi.

That should not happen and in particular leads to a half broken system, becauso also the sudo executable is not owned by root anymore and any call with sudo will lead to the following error message:

sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

I could only recover the functionality by mounting the SD card into another linux system and chown all files to root again.

I tried to debug and understand the script line by line. I could not identify the culprit line. I tried to execute the particular steps for installing nodeJS with the commands from the scripts manually.

curl -sSL -o /tmp/node.tgz https://unofficial-builds.nodejs.org/download/release/v18.12.0/node-v18.12.0-linux-armv6l.tar.gz
mkdir -p /tmp/nodejs
tar -zxof /tmp/node.tgz --strip-components=1 -C /tmp/nodejs
sudo chown -R 0:0 /tmp/nodejs
sudo cp -PR /tmp/nodejs/* /usr/
sudo rm -rf /tmp/nodejs
rm /tmp/node.tgz

# finally
update-nodejs-and-nodered --confirm-install --confirm-pi

Surprisingly (or not as I did not find any suspecious call) this does work as expected and does not mess up the rights.

So unfortunately I could not nail it down to a particular line within the script, otherwise I had created a PR with a potential fix.

NodeRed install script fails for ubuntu 20.10 desktop on raspberry pi

Which node are you reporting an issue on?

Node-Red install script: https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered

What are the steps to reproduce?

Using image ubuntu-20.10-preinstalled-desktop-arm64+raspi.img.xz
sudo apt update
sudo apt upgrade
sudo apt full-upgrade

sudo rpi-eeprom-update
#CURRENT: Thu 03 Sep 2020 12:11:43 PM UTC (1599135103)

#misc
sudo adp intsall -y curl

#Python3
sudo apt install -y python3 python3-dev
sudo apt install -y python3-pip

#NodeRED
#https://nodered.org/docs/getting-started/raspberrypi
sudo apt install -y build-essential git
#bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

What happens?

Receive the error folder not found
Installation aborts/does not complete

What do you expect to happen?

NodeRed installs

Please tell us about your environment:

  • Node-RED version: 1.2.6
  • node.js version: 14.15.1
  • npm version: 6.4.8
  • Platform/OS: Raspberry Pi 4Model B 4GB firmware version 1599135103, ubuntu-20.10-preinstalled-desktop-arm64+raspi.img.xz
  • Browser: FireFox

script does not check or abort if user is not in sudoer group

Hi!
Running the script on a debian 12 system (sudo is installed) the script does not abort if the user (under which the script is run) is not in the sudoers group. As it is very unintuitive to abort from the password prompt and being in sudoers group is a hard requirement, this should be checked first.

Expected behaviour: abort with error

The used command was:
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --nodered-user=xxxxxx --skip-pi --node20

Cheers

Update via parallel-ssh?

I am trying to update several units in parallel via ssh. I can run the script (here for debian), but the root passord is needed and it can't be passed via a pipe (I tryied echo 'password' | bash ... , and echo 'password' | sudo -S bash ...).

Is there a way to pass the password or run the script without the need for a password? Or another way around this?

Will installation with options --confirm-root and --nodered-user=pi install node-red for pi-user or for root?

Hope add some suggestions for Chinese users

In China, we are so slowly download node-js and its packages by using nodejs offical website.

But unlucky Chinese university like tsinghua and big company like taobao.inc can provide us its mirror website.

I hope you can add my suggestions in readme.md and node-red webiste:

For debian/raspbian:

If you are Chinese user, we suggest you to change your node-js offical mirror to Chinese mirror,
如果您在**请使用国内镜像源获取更好的下载体验,

run curl -sL https://deb.nodesource.com/setup_12.x | sudo bash - ,
示例:curl -sL https://deb.nodesource.com/setup_12.x | sudo bash - 从官方安装apt源,

then please edit apt source list/etc/apt/sources.list.d/nodesource.list like this:
编辑镜像源/etc/apt/sources.list.d/nodesource.list 修改如下:

#deb https://deb.nodesource.com/node_12.x buster main
#deb-src https://deb.nodesource.com/node_12.x buster main
deb https://mirrors.tuna.tsinghua.edu.cn/nodesource/deb_12.x buster main
deb-src https://mirrors.tuna.tsinghua.edu.cn/nodesource/deb_12.x buster main

if you edit it. Please runsudo apt-get update.
更改镜像源后应该刷新缓存,请运行`sudo apt-get update``

also,you can change npm sourcenpm config set registry https://registry.npm.taobao.org
同样,建议修改npm安装源为淘宝镜像源npm config set registry https://registry.npm.taobao.org

For CentOS:

If you are Chinese user, we suggest you to change your node-js offical mirror to Chinese mirror,
如果您在**请使用国内镜像源获取更好的下载体验,

visit https://mirrors.tuna.tsinghua.edu.cn/nodesource/ and see which version do you need, you can add its yum source list like this rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/nodesource/rpm_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm
请找到适合您的rpm源安装包

then edit yum source list /etc/yum.repos.d/nodesource-el7.repo like this:
然后编辑nodesource源如下(请根据实际情况修改):

[nodesource]
name=Node.js Packages for Enterprise Linux 7 - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/nodesource/rpm_10.x/el/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL

[nodesource-source]
name=Node.js for Enterprise Linux 7 - $basearch - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/nodesource/rpm_10.x/el/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
gpgcheck=1

please make cache again by runing sudo yum makecache
更改镜像源后请刷新缓存。

also,you can change npm sourcenpm config set registry https://registry.npm.taobao.org
同样,建议修改npm安装源为淘宝镜像源npm config set registry https://registry.npm.taobao.org

refer:
1.Nodesource 镜像使用帮助
2.淘宝 NPM 镜像
3.https://github.com/nodesource/distributions

Thank you!

setcap in deb installer

I've been hunting down a problem using the NODE_PATH environment variable to find globally installed modules on some systems.

Which led me to this StackOverflow post which pointed to the problem potentially being related to a capability being set on the node binary. As it turned out, all of the systems that were having issues with NODE_PATH had the cap_net_raw+eip capability and some more searching led me to the node-red scripted installer

sudo setcap cap_net_raw+eip $(eval readlink -f `which node`) 2>&1 | sudo tee -a /var/log/nodered-install.log >>/dev/null

Can you explain what the purpose this capability serves as far as node-red and node-red-contrib modules are concerned?

To silently break a piece of Node.js is less than ideal especially when the installer script is the strongly recommended way to get node-red on a Raspberry Pi (and from the looks of it, any Debian-based system that has a Broadcom CPU).

I understand that it probably isn't realistic to remove this from the installer at this point since some nodes will expect that capability but having an option to not set the capability and a note on this page mentioning it for future revisions of the installer would be great.

Thanks!

Install script fails on Raspbian buster (Failed to install Node.js )

OS : openHABian 2.5.6 (Raspbian buster)
Package update : 16-07-2020

This occur at stage "Install Node.js" :

  Stop Node-RED                            ✔
  Remove old version of Node-RED ✔
  Remove old version of Node.js       -
  Install Node.js TLS                         ✘   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

/var/log/nodered-install.log give me no clue :

Started : Thu 16 Jul 2020 05:58:19 PM CEST
Running for user openhabian at /home/openhabian
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
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Already have nodejs
Now install nodejs
Versions: node: npm:

Tell me if you have any suggestion to improve my bug report

Changes required for updating to Node14 / Node-RED v2

Part of Node-RED v2 is dropping support from node v8 and 10. While are at it we may as well make the default install the current LTS version 14.

The current install/upgrade script leaves node 10 and 12 alone. If other version found it will install node 12.
It also then runs npm rebuild in the .node-red directory in order to update any existing nodes in there.

However we know that while most older nodes with a binary component will recompile ok - some either won't (usually they have even older pre-reqs internally like older serialport versions) - or the currently installed version of the node also needs updating first so it is "node14 ready"

This does leave us in several situations
0) Some may just work

  1. Some nodes are just going to break/be broken and won't be recoverable
  2. Some nodes may just recompile and work
  3. Some may need upgrading first - then compile ok - but may then break flows due to other changes they have
  4. Some may upgrade - recompile and then work.

Hopefully most would be in the last camp but... we need to somehow warn people the other cases may occur, and ideally offer a way out.

Currently the script won't force a node.js upgrade - but as node 8 and 10 will be end of life we need to do something.

Option A

  1. Leave existing script - but add warning saying Node-RED v2 may not work / is unsupported - and user should prepare to migrate.
    2a) Add a new script that forces upgrade to nodejs14 - leaves existing extra nodes as-is - does a rebuild
    2b) Add a new script that forces upgrade to nodejs14 - tries to reinstall any extra nodes @latest - does a rebuild

either with warnings that nodes may break when they do.... offer chance to escape first.

Option B

  • Add a --force option (or similar) to existing script that forces the upgrade but with added warnings and chances to cancel.

Other - TBD

Raspberry pi install script fails with valid node.js but without npm installed

When I run the script with a valid node.js install but without npm installed, the installer script fails.

Terminal output:


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       -
  Leave existing Node.js              ✘   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

nodered-install.log:

Running for user pi at /home/pi
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 package was automatically installed and is no longer required:
  dc
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Already have nodejs v10.19.0
Now install nodejs

Run the script without any questions?

Adding this to the case statement for the options makes the script a run unimpeded and automatable. With this change, I can run this in ansible.

Change this:

      --confirm-pi)
        CONFIRM_PI="y"
        shift
        ;;
      --nodered-version=*)
        NODERED_VERSION="${1#*=}"
        shift
        ;;

to this:

      --confirm-pi)
        CONFIRM_PI="y"
        shift
        ;;
      --skip-pi)
        CONFIRM_PI="n"
        shift
        ;;
      --nodered-version=*)
        NODERED_VERSION="${1#*=}"
        shift
        ;;

Then you can execute the command to install on Ubuntu without questions with the following:

$ ./update-nodejs-and-nodered --confirm-install --skip-pi

Perhaps there's a better approach, but this works for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.