NR Install Script - “Failed to install node.js” error

Hi

I’ve been trying to install Node Red using a headless Debian OS on a virtual machine, but whenever I try to run the provided NR script (https://nodered.org/docs/getting-started/raspberrypi) , it does not get past the install node.js stage; always returning an error.

Attached is an extract of the log file, which has got tho the same place multiple times now.

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

Started : Tue 30 Jul 01:32:21 BST 2019
Running for user chris at /home/chris
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

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 'nodejs' 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:
  gyp javascript-common libc-ares2 libjs-inherits libjs-is-typedarray
  libnode-dev libnode64 libssl-dev libuv1 libuv1-dev nodejs-doc
  python-pkg-resources
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

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


## Populating apt-get cache...

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

## Confirming "buster" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_10.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 10.x repo...

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

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

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

## Run `sudo apt-get install -y nodejs` to install Node.js 10.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...
The following packages were automatically installed and are no longer required:
  gyp javascript-common libjs-inherits libjs-is-typedarray libnode-dev
  libssl-dev libuv1-dev python-pkg-resources
Use 'sudo apt autoremove' to remove them.
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 86.3 kB of archives.
After this operation, 160 kB of additional disk space will be used.
Get:1 http://ftp.uk.debian.org/debian buster/main i386 nodejs i386 10.15.2~dfsg-2 [86.3 kB]
Fetched 86.3 kB in 0s (824 kB/s)
Selecting previously unselected package nodejs.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 34044 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) ...

Other notes..

Debian version = 10.0
Node -v = v10.15.2

I followed the guidance “ apt-get install build-essential’ was installed too, so that available.
Also curl and sudo (with me as a user added) installed (both were missing)

You can install manually.

First install node.js and then run
sudo npm install -g --unsafe-perm node-red or the script.

Thanks @bakman2

Just to confirm Node.js is already installed.

Running npm returns the following.

Ok, i’m running the npm install now, so will try it again, once completed.

sudo apt install npm

@nodecentral the version of node packaged by Debian does not include npm. This is why our script removes that version and tries to install from the nodesource repo instead.

Can you just try rerunning the script?

If it still fails, may need @dceejay to comment.

Hi @knolleary

Sure, will do..

FYI - i’ve just tried the suggestion from @bakman2 again, and it returned the following errors instantly, let’s see how the script does now..

Full extract below..

chris@NodeCentral-NR:~$ sudo npm install -g --unsafe-perm node-red
npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
/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-v64-linux-ia32-glibc.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@10.15.2 (node-v64 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:
/usr/include/nodejs/src/node.h:570: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),                          \
                                           ^
/usr/include/nodejs/src/node.h:604: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);
 ^~~~~~~~~~~
In file included from /usr/include/nodejs/src/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/bcrypt_node.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/usr/include/nodejs/src/node_object_wrap.h:85:78:   required from here
/usr/include/nodejs/deps/v8/include/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/nodejs/deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/usr/include/nodejs/deps/v8/include/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
  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@0.20.7
added 368 packages from 352 contributors in 58.325s
chris@NodeCentral-NR:~$ 

(edited my message after you posted the full log)

That install has worked.

Same error when running the script

Log below.

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

Started : Tue 30 Jul 09:46:12 BST 2019
Running for user chris at /home/chris
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

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
The following packages were automatically installed and are no longer required:
  gyp javascript-common libc-ares2 libjs-inherits libjs-is-typedarray
  libnode-dev libnode64 libssl-dev libuv1 libuv1-dev nodejs-doc
  python-pkg-resources
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  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-gyp
  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 npm
0 upgraded, 0 newly installed, 241 to remove and 0 not upgraded.
After this operation, 16.7 MB disk space will be freed.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 38798 files and directories currently installed.)
Removing npm (5.8.0+ds6-4) ...
Removing node-gyp (3.8.0-6) ...
Removing node-nopt (3.0.6-3) ...
Removing node-abbrev (1.1.1-1) ...
Removing node-request (2.88.1-2) ...
Removing node-har-validator (5.1.0-1) ...
Removing node-ajv (5.0.0-1) ...
Removing node-ansi (0.3.0-3) ...
Removing node-boxen (1.2.2-1) ...
Removing node-ansi-align (2.0.0-1) ...
Removing node-libnpx (10.2.0+repack-1) ...
Removing node-yargs (10.0.3-2) ...
Removing node-cliui (4.1.0-1) ...
Removing node-wrap-ansi (4.0.0-1) ...
Removing node-chalk (2.3.0-2) ...
Removing node-ansi-styles (3.2.1-1) ...
Removing node-ansistyles (0.1.3-1) ...
Removing node-npmlog (4.1.2-1) ...
Removing node-gauge (2.7.4-1) ...
Removing node-cacache (11.3.2-2) ...
Removing node-move-concurrently (1.0.1-2) ...
Removing node-archy (1.0.0-2) ...
Removing node-are-we-there-yet (1.1.4-1) ...
Removing node-http-signature (1.2.0-1) ...
Removing node-sshpk (1.13.1+dfsg-2) ...
Removing node-asn1 (0.2.3-1) ...
Removing node-dashdash (1.14.1-2) ...
Removing node-jsprim (1.4.0-1) ...
Removing node-verror (1.10.0-1) ...
Removing node-form-data (2.3.2-2) ...
Removing node-asynckit (0.4.0-2) ...
Removing node-aws-sign2 (0.7.1-1) ...
Removing node-aws4 (1.8.0-1) ...
Removing node-read-package-json (2.0.13-1) ...
Removing node-copy-concurrently (1.0.5-4) ...
Removing node-bcrypt-pbkdf (1.0.1-1) ...
Removing node-bluebird (3.5.1+dfsg2-2) ...
Removing node-normalize-package-data (2.4.0-1) ...
Removing node-is-builtin-module (2.0.0-1) ...
Removing node-builtin-modules (3.0.0-1) ...
Removing node-npm-package-arg (6.0.0-2) ...
Removing node-validate-npm-package-name (3.0.0-1) ...
Removing node-builtins (1.0.3-1) ...
Removing node-call-limit (1.1.0-1) ...
Removing node-yargs-parser (11.1.1-1) ...
Removing node-camelcase (5.0.0-1) ...
Removing node-caseless (0.12.0-1) ...
Removing node-tar (4.4.6+ds1-3) ...
Removing node-chownr (1.1.1-1) ...
Removing node-cli-boxes (1.0.0-1) ...
Removing node-widest-line (1.2.2-1) ...
Removing node-co (4.6.0-1) ...
Removing node-color-convert (1.9.0-3) ...
Removing node-color-name (1.1.3-1) ...
Removing node-combined-stream (1.0.7-1) ...
Removing node-mississippi (3.0.0-1) ...
Removing node-concat-stream (1.6.2-1) ...
Removing node-config-chain (1.1.11-1) ...
Removing node-console-control-strings (1.1.0-1) ...
Removing node-through2 (2.0.5-2) ...
Removing node-flush-write-stream (1.0.3-1) ...
Removing node-term-size (1.2.0+dfsg-2) ...
Removing node-os-locale (2.0.0-1) ...
Removing node-execa (0.10.0+dfsg-1) ...
Removing node-cross-spawn (5.1.0-2) ...
Removing node-parallel-transform (1.1.0-2) ...
Removing node-cyclist (1.0.1-2) ...
Removing node-decamelize (1.2.0-1) ...
Removing node-latest-version (3.1.0-1) ...
Removing node-package-json (4.0.1-1) ...
Removing node-got (7.1.0-1) ...
Removing node-decompress-response (3.3.0-1) ...
Removing node-registry-url (3.1.0-1) ...
Removing node-registry-auth-token (3.3.1-1) ...
Removing node-rc (1.1.6-2) ...
Removing node-deep-extend (0.4.1-2) ...
Removing node-delayed-stream (0.0.5-1) ...
Removing node-delegates (1.0.0-1) ...
Removing node-detect-indent (5.0.0-1) ...
Removing node-detect-newline (2.1.0-1) ...
Removing node-duplexer3 (0.1.4-4) ...
Removing node-pumpify (1.5.1-1) ...
Removing node-duplexify (3.6.1-1) ...
Removing node-ecc-jsbn (0.1.1-1) ...
Removing node-editor (1.0.0-1) ...
Removing node-encoding (0.1.12-2) ...
Removing node-stream-each (1.2.2-2) ...
Removing node-pump (3.0.0-1) ...
Removing node-end-of-stream (1.4.1-1) ...
Removing node-errno (0.1.4-1) ...
Removing node-escape-string-regexp (1.0.5-1) ...
Removing node-extend (3.0.2-1) ...
Removing node-extsprintf (1.3.0-1) ...
Removing node-find-up (2.1.0-1) ...
Removing node-forever-agent (0.6.1-1) ...
Removing node-from2 (2.3.0-1) ...
Removing node-fs-vacuum (1.2.10-2) ...
Removing node-fs-write-stream-atomic (1.0.10-4) ...
Removing node-get-caller-file (1.0.2-1) ...
Removing node-get-stream (3.0.0-1) ...
Removing node-getpass (0.1.7-1) ...
Removing node-write-file-atomic (2.3.0-1) ...
Removing node-sha (2.0.1-1) ...
Removing node-graceful-fs (4.1.11-1) ...
Removing node-har-schema (2.0.0-1) ...
Removing node-supports-color (4.4.0-2) ...
Removing node-has-flag (2.0.0-1) ...
Removing node-isurl (1.0.0-1) ...
Removing node-has-to-string-tag-x (1.4.1+dfsg-1) ...
Removing node-has-symbol-support-x (1.4.1+dfsg-1) ...
Removing node-has-unicode (2.0.1-2) ...
Removing node-hosted-git-info (2.7.1-1) ...
Removing node-iconv-lite (0.4.13-2) ...
Removing node-iferr (1.0.2-1) ...
Removing node-import-lazy (3.0.0.REALLY.2.1.0-1) ...
Removing node-unique-filename (1.1.0+ds-2) ...
Removing node-imurmurhash (0.1.4-1) ...
Removing node-ini (1.3.5-1) ...
Removing node-lcid (1.0.0-1) ...
Removing node-invert-kv (1.0.0-1) ...
Removing node-is-npm (1.0.0-1) ...
Removing node-is-object (1.0.1-1) ...
Removing node-is-plain-obj (1.1.0-1) ...
Removing node-is-retry-allowed (1.1.0-1) ...
Removing node-is-stream (1.1.0-1) ...
Removing node-is-typedarray (1.0.0-2) ...
Removing node-which (1.3.0-2) ...
Removing node-isexe (2.0.0-4) ...
Removing node-isstream (0.1.2+dfsg-1) ...
Removing node-jsbn (1.1.0-1) ...
Removing node-json-parse-better-errors (1.0.2-2) ...
Removing node-json-schema (0.2.3-1) ...
Removing node-json-stable-stringify (1.0.1-1) ...
Removing node-json-stringify-safe (5.0.1-1) ...
Removing node-jsonify (0.0.0-1) ...
Removing node-jsonstream (1.3.2-1) ...
Removing node-jsonparse (1.3.1-6) ...
Removing node-lazy-property (1.0.0-3) ...
Removing node-locate-path (2.0.0-1) ...
Removing node-lockfile (1.0.4-1) ...
Removing node-lowercase-keys (1.0.0-2) ...
Removing node-lru-cache (5.1.1-4) ...
Removing node-mem (1.1.0-1) ...
Removing node-mime-types (2.1.21-1) ...
Removing node-mimic-fn (1.1.0-1) ...
Removing node-mimic-response (1.0.0-1) ...
Removing node-minimist (1.2.0-1) ...
Removing node-mkdirp (0.5.1-1) ...
Removing node-promzard (0.3.0-1) ...
Removing node-read (1.0.7-1) ...
Removing node-mute-stream (0.0.8-1) ...
Removing node-node-uuid (3.3.2-2) ...
Removing node-npm-run-path (2.0.2-2) ...
Removing node-oauth-sign (0.9.0-1) ...
Removing node-object-assign (4.1.1-2) ...
Removing node-opener (1.4.3-1) ...
Removing node-osenv (0.1.5-1) ...
Removing node-p-cancelable (0.3.0-1) ...
Removing node-p-timeout (1.2.0-1) ...
Removing node-p-finally (1.0.0-2) ...
Removing node-p-locate (2.0.0-1) ...
Removing node-p-limit (1.1.0-1) ...
Removing node-path-exists (3.0.0-1) ...
Removing node-path-is-inside (1.0.2-1) ...
Removing node-performance-now (2.1.0+debian-1) ...
Removing node-url-parse-lax (1.0.0-1) ...
Removing node-prepend-http (2.0.0-1) ...
Removing node-promise-inflight (1.0.1-1) ...
Removing node-proto-list (1.2.4-1) ...
Removing node-prr (1.0.1-1) ...
Removing node-tough-cookie (2.3.4+dfsg-1) ...
Removing node-punycode (2.1.1-2) ...
Removing node-qs (6.5.2-1) ...
Removing node-qw (1.0.1-1) ...
Removing node-require-directory (2.1.1-1) ...
Removing node-require-main-filename (1.0.1-1) ...
Removing node-resolve-from (4.0.0-1) ...
Removing node-retry (0.10.1-1) ...
Removing node-tunnel-agent (0.6.1-1) ...
Removing node-semver-diff (2.1.0-2) ...
Removing node-semver (5.5.1-1) ...
Removing node-set-blocking (2.0.0-1) ...
Removing node-shebang-command (1.2.0-1) ...
Removing node-shebang-regex (2.0.0-1) ...
Removing node-signal-exit (3.0.2-1) ...
Removing node-slash (1.0.0-1) ...
Removing node-slide (1.1.6-2) ...
Removing node-sorted-object (2.0.1-1) ...
Removing node-validate-npm-package-license (3.0.1-1) ...
Removing node-spdx-correct (1.0.2-1) ...
Removing node-spdx-expression-parse (1.0.4-1) ...
Removing node-spdx-license-ids (1.2.2-1) ...
Removing node-ssri (5.2.4-2) ...
Removing node-stream-iterate (1.2.0-4) ...
Removing node-stream-shift (1.0.0-1) ...
Removing node-strip-eof (1.0.0-2) ...
Removing node-strip-json-comments (2.0.1-2) ...
Removing node-text-table (0.2.0-2) ...
Removing node-through (2.3.8-1) ...
Removing node-timed-out (4.0.1-4) ...
Removing node-tweetnacl (0.14.5+dfsg-3) ...
Removing node-typedarray (0.0.6-1) ...
Removing node-uid-number (0.0.6-1) ...
Removing node-unpipe (1.0.0-1) ...
Removing node-url-to-options (1.0.1-1) ...
Removing node-uuid (3.3.2-2) ...
Removing node-which-module (2.0.0-1) ...
Removing node-wide-align (1.1.0-1) ...
Removing node-xdg-basedir (3.0.0-1) ...
Removing node-xtend (4.0.1-2) ...
Removing node-y18n (3.2.1-2) ...
Removing node-yallist (3.0.3-1) ...
Removing node-run-queue (1.0.3-1) ...
Removing node-aproba (1.2.0-1) ...
Removing node-assert-plus (1.0.0-1) ...
Removing node-rimraf (2.6.2-1) ...
Removing node-glob (7.1.3-2) ...
Removing node-minimatch (3.0.4-3) ...
Removing node-brace-expansion (1.1.8-1) ...
Removing node-balanced-match (0.4.2-1) ...
Removing node-string-width (2.1.1-1) ...
Removing node-wcwidth.js (1.0.0-1) ...
Removing node-defaults (1.0.3-1) ...
Removing node-clone (2.1.2-1) ...
Removing node-concat-map (0.0.1-1) ...
Removing node-readable-stream (2.3.6-1) ...
Removing node-core-util-is (1.0.2-1) ...
Removing node-fs.realpath (1.0.0-1) ...
Removing node-inflight (1.0.6-1) ...
Removing node-inherits (2.0.3-1) ...
Removing node-isarray (2.0.4-1) ...
Removing node-once (1.4.0-3) ...
Removing node-path-is-absolute (1.0.0-1) ...
Removing node-process-nextick-args (2.0.0-1) ...
Removing node-string-decoder (1.2.0-1) ...
Removing node-safe-buffer (5.1.2-1) ...
Removing node-util-deprecate (1.0.2-1) ...
Removing node-wrappy (1.0.2-1) ...
Removing node-strip-ansi (4.0.0-1) ...
Removing node-ansi-regex (3.0.0-1) ...
Removing nodejs (10.15.2~dfsg-2) ...
Processing triggers for man-db (2.8.5-2) ...

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


## Populating apt-get cache...

+ apt-get update
Hit:1 http://ftp.uk.debian.org/debian buster InRelease
Get:2 http://ftp.uk.debian.org/debian buster-updates InRelease [46.8 kB]
Hit:3 https://deb.nodesource.com/node_10.x buster InRelease
Hit:4 http://security.debian.org/debian-security buster/updates InRelease
Fetched 46.8 kB in 2s (30.7 kB/s)
Reading package lists...

## Confirming "buster" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_10.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 10.x repo...

+ echo 'deb https://deb.nodesource.com/node_10.x buster main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_10.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/debian-security buster/updates InRelease
Hit:2 http://ftp.uk.debian.org/debian buster InRelease
Hit:3 http://ftp.uk.debian.org/debian buster-updates InRelease
Hit:4 https://deb.nodesource.com/node_10.x buster InRelease
Reading package lists...

## Run `sudo apt-get install -y nodejs` to install Node.js 10.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...
The following packages were automatically installed and are no longer required:
  gyp javascript-common libjs-inherits libjs-is-typedarray libnode-dev
  libssl-dev libuv1-dev python-pkg-resources
Use 'sudo apt autoremove' to remove them.
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 86.3 kB of archives.
After this operation, 160 kB of additional disk space will be used.
Get:1 http://ftp.uk.debian.org/debian buster/main i386 nodejs i386 10.15.2~dfsg-2 [86.3 kB]
Fetched 86.3 kB in 0s (718 kB/s)
Selecting previously unselected package nodejs.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 34044 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) ...

Oh, ok - cool - what should I do/check to confirm it works ?

Sadly no luck with the provided script :frowning:

Try running node-red .... ?

This will have only installed node-red as a global module. It will not have set it up as a service to auto start on boot - that is what the script does.

the weirdness is that in the original log we can see it has the correct repo

Hit:4 https://deb.nodesource.com/node_10.x buster InRelease

but then goes and uses the debian one

Get:1 http://ftp.uk.debian.org/debian buster/main i386 nodejs i386 10.15.2~dfsg-2 [86.3 kB]

but this seems to be because it is trying to load an i386 version... What hardware is this on ?

I’m using my NAS (below) as the host to run this Debian VM

Looking at the .iso used for the VM, (4 x CPU, 4GB RAM, 200GB storage) it’s...

debian-10.0.0-i386-netinst.iso

If you can use a 64 bit version instead it would go smoother

I’ll have a go later and build a new vm with this..

https://cdimage.debian.org/mirror/cdimage/release/current/amd64/iso-cd/debian-10.0.0-amd64-netinst.iso

Considering what I’ve done/installed so far; is there a way (maybe a script out there I could use) to do a sanity check to confirm if what I’ve already installed is all good ?

There has been various packages required e.g sudo, curl, npm, node,js, node-red, and many different versions ? Be good to have a way to do a quick verification/validation?

I think that I would walk through the script and make sure that I had each step now sorted.

sudo and curl would/should be the only ones that we don't install as they are usually there in most default installs... (and build-essential as already noted)... so check those are present and then hopefully the script would work. - easiest way to check at end is to run node-red :slight_smile:

When i was setting up my VMs initially i used the Peter Scargill script as it went through the total thing from the download of the ISO and complete OS setup and then pulled down all the required stuff.

It has worked well for me - and then i have just updated using standard NR instructions and had no issues to this point - more importantly it specifically addresses permissions issues and handles correct versions of the various dependencies.

Have a read here

Scroll down to where they talk about the VM - i use Ubuntu as one of the key things is that it can upgrade across major versions (unlike many of the other distros)

Craig

Ok, here goes...

Using the Debian v10 image downloaded earlier; i’ve created a VM (4 x CPU, 6 GB RAM)

i) I’ve then run the following additional installs ..

apt-get install build-essential
apt-get install sudo 
   - followed by /usr/sbin/usermod -aG sudo <USERNAME> command
apt-get install curl
apt-get install net-tools  (for a static IP)

ii) And then run the recommended script from https://nodered.org/docs/getting-started/raspberrypi ...

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

And SUCCESS - no errors, now time to have a play !!!!

Running Node Red is also error free..

1 Like