Node-red-contrib-nrf24 install problems

Hi
I am very new here and to Node Red for that matter. I installed HomeBridge on a rpi zero from the pre-compiled image. Then I installed Node Red from the HB config utility. That is all running fine.
I then tried to install node-red-contrib-nrf24 and it failed with this command:
sudo npm install node-red-contrib-nrf24 and got this error:
current user ("pi") does not have permission to access the dev dir "/root/.cache/node-gyp/16.14.0"

and then many errors after that.
What can I look for here please?

I don't use HomeBridge, but is that how you are supposed to install additional nodes in that environment?

Correct, the instructions are not to use the palette.
This is where I found the instructions :- https://flows.nodered.org/node/node-red-contrib-nrf24

It doesn't say there to use sudo, but it does say it root access, which is unusual. By using sudo but without -g you may mess up the permissions in your home folder. However you have used sudo and still can't install it, so I don't know what is going on.

You could try
sudo npm -g --unsafe-perm node-red-contrib-nrf24

Alternatively it does suggest installing the components separately which you could try.

I notice the node has not been updated in 4 years, so whether it still works I don't know.

I did try the separate install. It would seem that they updated the examples about 17 months ago

This is the complete log file. Maybe that can help

Seems like a new user cannot upload so here is the text.


0 verbose cli [
0 verbose cli   '/usr/local/bin/node',
0 verbose cli   '/usr/local/bin/npm',
0 verbose cli   'i',
0 verbose cli   'node-red-contrib-nrf24'
0 verbose cli ]
1 info using npm@8.3.1
2 info using node@v16.14.0
3 timing npm:load:whichnode Completed in 3ms
4 timing config:load:defaults Completed in 49ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 19ms
6 timing config:load:builtin Completed in 23ms
7 timing config:load:cli Completed in 47ms
8 timing config:load:env Completed in 9ms
9 timing config:load:file:/home/pi/.node-red/.npmrc Completed in 2ms
10 timing config:load:project Completed in 19ms
11 timing config:load:file:/home/pi/.npmrc Completed in 2ms
12 timing config:load:user Completed in 8ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 1ms
14 timing config:load:global Completed in 5ms
15 timing config:load:validate Completed in 3ms
16 timing config:load:credentials Completed in 32ms
17 timing config:load:setEnvs Completed in 25ms
18 timing config:load Completed in 243ms
19 timing npm:load:configload Completed in 248ms
20 timing npm:load:setTitle Completed in 7ms
21 timing config:load:flatten Completed in 90ms
22 timing npm:load:display Completed in 143ms
23 verbose logfile /home/pi/.npm/_logs/2022-03-02T15_40_43_582Z-debug-0.log
24 timing npm:load:logFile Completed in 137ms
25 timing npm:load:timers Completed in 1ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 562ms
28 timing arborist:ctor Completed in 48ms
29 silly logfile start cleaning logs, removing 1 files
30 timing arborist:ctor Completed in 3ms
31 timing idealTree:init Completed in 607ms
32 timing idealTree:userRequests Completed in 59ms
33 silly idealTree buildDeps
34 silly fetch manifest node-red-contrib-nrf24@*
35 http fetch GET 200 https://registry.npmjs.org/node-red-contrib-nrf24 2719ms (cache revalidated)
36 silly placeDep ROOT node-red-contrib-nrf24@0.2.0 OK for: node-red-project@0.0.1 want: *
37 silly fetch manifest bindings@^1.5.0
38 silly fetch manifest nrf24@0.1.7-beta
39 http fetch GET 200 https://registry.npmjs.org/bindings 1089ms (cache revalidated)
40 http fetch GET 200 https://registry.npmjs.org/nrf24 1933ms (cache revalidated)
41 timing idealTree:#root Completed in 4980ms
42 silly placeDep ROOT bindings@1.5.0 OK for: node-red-contrib-nrf24@0.2.0 want: ^1.5.0
43 silly placeDep ROOT nrf24@0.1.7-beta OK for: node-red-contrib-nrf24@0.2.0 want: 0.1.7-beta
44 silly fetch manifest file-uri-to-path@1.0.0
45 silly fetch manifest nan@^2.14.0
46 silly fetch manifest nan-check@0.0.6
47 http fetch GET 200 https://registry.npmjs.org/file-uri-to-path 911ms (cache revalidated)
48 http fetch GET 200 https://registry.npmjs.org/nan 881ms (cache revalidated)
49 http fetch GET 200 https://registry.npmjs.org/nan-check 2237ms (cache revalidated)
50 timing idealTree:node_modules/node-red-contrib-nrf24 Completed in 2623ms
51 silly placeDep ROOT file-uri-to-path@1.0.0 OK for: bindings@1.5.0 want: 1.0.0
52 timing idealTree:node_modules/bindings Completed in 56ms
53 timing idealTree:node_modules/file-uri-to-path Completed in 1ms
54 silly placeDep ROOT nan@2.15.0 OK for: nrf24@0.1.7-beta want: ^2.14.0
55 silly placeDep ROOT nan-check@0.0.6 OK for: nrf24@0.1.7-beta want: 0.0.6
56 silly fetch manifest nan-marshal@0.0.5
57 http fetch GET 200 https://registry.npmjs.org/nan-marshal 1645ms (cache revalidated)
58 timing idealTree:node_modules/nrf24 Completed in 1839ms
59 timing idealTree:node_modules/nan Completed in 0ms
60 silly placeDep ROOT nan-marshal@0.0.5 OK for: nan-check@0.0.6 want: 0.0.5
61 timing idealTree:node_modules/nan-check Completed in 52ms
62 timing idealTree:node_modules/nan-marshal Completed in 1ms
63 timing idealTree:buildDeps Completed in 9596ms
64 timing idealTree:fixDepFlags Completed in 26ms
65 timing idealTree Completed in 10322ms
66 timing reify:loadTrees Completed in 10341ms
67 timing reify:diffTrees Completed in 32ms
68 silly reify moves {}
69 timing reify:retireShallow Completed in 8ms
70 timing reify:createSparse Completed in 99ms
71 timing reify:loadBundles Completed in 1ms
72 silly audit bulk request {
72 silly audit   'node-red-contrib-nrf24': [ '0.2.0' ],
72 silly audit   bindings: [ '1.5.0' ],
72 silly audit   nrf24: [ '0.1.7-beta' ],
72 silly audit   'file-uri-to-path': [ '1.0.0' ],
72 silly audit   nan: [ '2.15.0' ],
72 silly audit   'nan-check': [ '0.0.6' ],
72 silly audit   'nan-marshal': [ '0.0.5' ]
72 silly audit }
73 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 886ms
74 timing auditReport:getReport Completed in 918ms
75 silly audit report {}
76 timing auditReport:init Completed in 0ms
77 timing reify:audit Completed in 941ms
78 timing reifyNode:node_modules/bindings Completed in 2588ms
79 timing reifyNode:node_modules/file-uri-to-path Completed in 2789ms
80 timing reifyNode:node_modules/node-red-contrib-nrf24 Completed in 3288ms
81 timing reifyNode:node_modules/nan-marshal Completed in 3426ms
82 timing reifyNode:node_modules/nan-check Completed in 3636ms
83 timing reifyNode:node_modules/nan Completed in 4186ms
84 timing reifyNode:node_modules/nrf24 Completed in 4226ms
85 timing reify:unpack Completed in 4250ms
86 timing reify:unretire Completed in 4ms
87 timing build:queue Completed in 47ms
88 info run nrf24@0.1.7-beta preinstall node_modules/nrf24 ./build_rf24libs.sh
89 info run nrf24@0.1.7-beta preinstall { code: 0, signal: null }
90 timing build:run:preinstall:node_modules/nrf24 Completed in 174069ms
91 timing build:run:preinstall Completed in 174091ms
92 info run nrf24@0.1.7-beta install node_modules/nrf24 node-gyp rebuild
93 info run nrf24@0.1.7-beta install { code: 1, signal: null }
94 timing reify:rollback:createSparse Completed in 1253ms
95 timing reify:rollback:retireShallow Completed in 1ms
96 timing command:i Completed in 250079ms
97 verbose stack Error: command failed
97 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
97 verbose stack     at ChildProcess.emit (node:events:520:28)
97 verbose stack     at maybeClose (node:internal/child_process:1092:16)
97 verbose stack     at Socket.<anonymous> (node:internal/child_process:451:11)
97 verbose stack     at Socket.emit (node:events:520:28)
97 verbose stack     at Pipe.<anonymous> (node:net:687:12)
98 verbose pkgid nrf24@0.1.7-beta
99 verbose cwd /home/pi/.node-red
100 verbose Linux 5.10.17+
101 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "node-red-contrib-nrf24"
102 verbose node v16.14.0
103 verbose npm  v8.3.1
104 error code 1
105 error path /home/pi/.node-red/node_modules/nrf24
106 error command failed
107 error command sh -c node-gyp rebuild
108 error make: Entering directory '/home/pi/.node-red/node_modules/nrf24/build'
108 error   CXX(target) Release/obj.target/nRF24/irq.o
108 error make: Leaving directory '/home/pi/.node-red/node_modules/nrf24/build'
109 error gyp info it worked if it ends with ok
109 error gyp info using node-gyp@8.4.1
109 error gyp info using node@16.14.0 | linux | arm
109 error gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
109 error gyp WARN EACCES current user ("pi") does not have permission to access the dev dir "/home/pi/.cache/node-gyp/16.14.0"
109 error gyp WARN EACCES attempting to reinstall using temporary dev dir "/tmp/.node-gyp"
109 error gyp info spawn /usr/bin/python3
109 error gyp info spawn args [
109 error gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
109 error gyp info spawn args   'binding.gyp',
109 error gyp info spawn args   '-f',
109 error gyp info spawn args   'make',
109 error gyp info spawn args   '-I',
109 error gyp info spawn args   '/home/pi/.node-red/node_modules/nrf24/build/config.gypi',
109 error gyp info spawn args   '-I',
109 error gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
109 error gyp info spawn args   '-I',
109 error gyp info spawn args   '/tmp/.node-gyp/16.14.0/include/node/common.gypi',
109 error gyp info spawn args   '-Dlibrary=shared_library',
109 error gyp info spawn args   '-Dvisibility=default',
109 error gyp info spawn args   '-Dnode_root_dir=/tmp/.node-gyp/16.14.0',
109 error gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
109 error gyp info spawn args   '-Dnode_lib_file=/tmp/.node-gyp/16.14.0/<(target_arch)/node.lib',
109 error gyp info spawn args   '-Dmodule_root_dir=/home/pi/.node-red/node_modules/nrf24',
109 error gyp info spawn args   '-Dnode_engine=v8',
109 error gyp info spawn args   '--depth=.',
109 error gyp info spawn args   '--no-parallel',
109 error gyp info spawn args   '--generator-output',
109 error gyp info spawn args   'build',
109 error gyp info spawn args   '-Goutput_dir=.'
109 error gyp info spawn args ]
109 error gyp info spawn make
109 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
109 error In file included from /tmp/.node-gyp/16.14.0/include/node/v8.h:30,
109 error                  from /tmp/.node-gyp/16.14.0/include/node/node.h:63,
109 error                  from ../../nan/nan.h:58,
109 error                  from ../rf24_config.hpp:6,
109 error                  from ../irq.hpp:3,
109 error                  from ../irq.cc:2:
109 error /tmp/.node-gyp/16.14.0/include/node/v8-internal.h: In function ‘void v8::internal::PerformCastCheck(T*)’:
109 error /tmp/.node-gyp/16.14.0/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not a member of ‘std’
109 error              !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
109 error                                       ^~~~~~~~~~~
109 error /tmp/.node-gyp/16.14.0/include/node/v8-internal.h:492:38: note: suggested alternative: ‘remove_cv’
109 error              !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
109 error                                       ^~~~~~~~~~~
109 error                                       remove_cv
109 error /tmp/.node-gyp/16.14.0/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not a member of ‘std’
109 error /tmp/.node-gyp/16.14.0/include/node/v8-internal.h:492:38: note: suggested alternative: ‘remove_cv’
109 error              !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
109 error                                       ^~~~~~~~~~~
109 error                                       remove_cv
109 error /tmp/.node-gyp/16.14.0/include/node/v8-internal.h:492:50: error: template argument 2 is invalid
109 error              !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
109 error                                                   ^
109 error /tmp/.node-gyp/16.14.0/include/node/v8-internal.h:492:63: error: ‘::Perform’ has not been declared
109 error              !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
109 error                                                                ^~~~~~~
109 error /tmp/.node-gyp/16.14.0/include/node/v8-internal.h:492:63: note: suggested alternative: ‘herror’
109 error              !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
109 error                                                                ^~~~~~~
109 error                                                                herror
109 error make: *** [nRF24.target.mk:145: Release/obj.target/nRF24/irq.o] Error 1
109 error gyp ERR! build error 
109 error gyp ERR! stack Error: `make` failed with exit code: 2
109 error gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
109 error gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
109 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
109 error gyp ERR! System Linux 5.10.17+
109 error gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
109 error gyp ERR! cwd /home/pi/.node-red/node_modules/nrf24
109 error gyp ERR! node -v v16.14.0
109 error gyp ERR! node-gyp -v v8.4.1
109 error gyp ERR! not ok
110 verbose exit 1
111 timing npm Completed in 257397ms
112 verbose unfinished npm timer reify 1646235650046
113 verbose unfinished npm timer reify:build 1646235665314
114 verbose unfinished npm timer build 1646235665323
115 verbose unfinished npm timer build:deps 1646235665325
116 verbose unfinished npm timer build:run:install 1646235839474
117 verbose unfinished npm timer build:run:install:node_modules/nrf24 1646235839475
118 verbose code 1
119 error A complete log of this run can be found in:
119 error     /home/pi/.npm/_logs/2022-03-02T15_40_43_582Z-debug-0.log

Did you try the command I suggested?

Hi,
i have the same problem have you managed to solve?

pi@ghostnrs:~ $ npm install node-red-contrib-nrf24

> nrf24@0.1.7-beta preinstall /home/pi/node_modules/nrf24
> ./build_rf24libs.sh

Buiding nrf24 library versions: RF24:v1.3.9 RF24NETWORK:v1.0.13 RF24MESH:v1.1.3 DRIVER:SPIDEV
Clone in 'RF24' in corso...
remote: Enumerating objects: 8814, done.
remote: Counting objects: 100% (3735/3735), done.
remote: Compressing objects: 100% (1150/1150), done.
remote: Total 8814 (delta 2645), reused 3598 (delta 2561), pack-reused 5079
Ricezione degli oggetti: 100% (8814/8814), 8.89 MiB | 2.71 MiB/s, fatto.
Risoluzione dei delta: 100% (5926/5926), fatto.
=>RF24...
Nota: eseguo il checkout di 'v1.3.9'.

Sei nello stato 'HEAD scollegato'. Puoi dare un'occhiata, apportare modifiche
sperimentali ed eseguirne il commit, e puoi scartare qualunque commit eseguito
in questo stato senza che ciò abbia alcuna influenza sugli altri branch tornando
su un branch.

Se vuoi creare un nuovo branch per mantenere i commit creati, puoi farlo
(ora o in seguito) usando l'opzione -c con il comando switch. Ad esempio:

  git switch -c <nome nuovo branch>

Oppure puoi annullare quest'operazione con:

  git switch -

Disattiva questo consiglio impostando la variabile di configurazione
advice.detachedHead a false

HEAD si trova ora a c0440e0 Fix compilation errors
c0440e0 (HEAD, tag: v1.3.9) Fix compilation errors
===> Building...
[SECTION] Detecting arm compilation environment.
  [INFO] arm-linux-gnueabihf-gcc not found.
  [INFO] arm-linux-gnueabihf-g++ not found.
[SECTION] Detecting target machine.
[OK] machine detected: SoC=BCM2835, Type=RPi, CPU=aarch64.
[SECTION] Detecting OS.
  [INFO] OS detected:LINUX.
[SECTION] Preparing configuration.
[SECTION] Saving configuration.
[SECTION] Cleaning previous builds.
[OK] Finished.
g++ -fPIC -marm -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -Ofast -Wall -pthread  -c RF24.cpp
g++: error: unrecognized command-line option ‘-marm’
g++: error: unrecognized command-line option ‘-mfpu=vfp’
g++: error: unrecognized command-line option ‘-mfloat-abi=hard’
make: *** [Makefile:42: RF24.o] Errore 1
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! nrf24@0.1.7-beta preinstall: `./build_rf24libs.sh`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the nrf24@0.1.7-beta preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2022-03-24T23_21_16_368Z-debug.log

No I have not. It seems like there is no support for this code so I have given up on it. Apart from that I have found that the NRF24 devices are not very reliable. At least not the cheap versions that we get from China. I purchased 10 units and I am having problems getting them to talk reliably. The problems vary so much that it is difficult to pinpoint them. If you Google you will find that many folks have similar issues. So as I said, I gave up - sadly.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.