Problems with node-red-contrib-opi-gpio

I am having trouble getting node-red-contrib-opi-gpio to install.
Platform is NanoPi NEO 2. Connection is via ethernet.
When I try installing from pallet manager, node install fails with a log that looks like this:
I cut a bunch of errors out of the middle since I could not fit into post size limit. I assume that once you have gone off the rails and into the next county, more detail isn't usually helpful.

0 verbose cli [
0 verbose cli   '/usr/bin/node',
0 verbose cli   '/usr/bin/npm',
0 verbose cli   'install',
0 verbose cli   '--no-audit',
0 verbose cli   '--no-update-notifier',
0 verbose cli   '--no-fund',
0 verbose cli   '--save',
0 verbose cli   '--save-prefix=~',
0 verbose cli   '--production',
0 verbose cli   'node-red-contrib-opi-gpio@0.0.5'
0 verbose cli ]
1 info using npm@7.19.0
2 info using node@v12.22.1
3 timing npm:load:whichnode Completed in 2ms
4 timing config:load:defaults Completed in 15ms
5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 5ms
6 timing config:load:builtin Completed in 7ms
7 verbose config production Use `--omit=dev` instead.
8 timing config:load:cli Completed in 25ms
9 timing config:load:env Completed in 2ms
10 timing config:load:file:/home/millheim/.node-red/.npmrc Completed in 1ms
11 timing config:load:project Completed in 10ms
12 timing config:load:file:/home/millheim/.npmrc Completed in 8ms
13 timing config:load:user Completed in 9ms
14 timing config:load:file:/usr/etc/npmrc Completed in 1ms
15 timing config:load:global Completed in 1ms
16 timing config:load:validate Completed in 1ms
17 timing config:load:credentials Completed in 10ms
18 timing config:load:setEnvs Completed in 6ms
19 timing config:load Completed in 89ms
20 timing npm:load:configload Completed in 90ms
21 timing npm:load:setTitle Completed in 1ms
22 timing npm:load:setupLog Completed in 3ms
23 timing npm:load:cleanupLog Completed in 15ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 4ms
26 timing npm:load Completed in 119ms
27 timing config:load:flatten Completed in 18ms
28 timing arborist:ctor Completed in 6ms
29 timing idealTree:init Completed in 1275ms
30 timing idealTree:userRequests Completed in 22ms
31 silly idealTree buildDeps
32 silly fetch manifest node-red-contrib-opi-gpio@0.0.5
33 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules
34 http fetch GET 200 https://registry.npmjs.org/node-red-contrib-opi-gpio 1570ms (cache revalidated)
35 silly placeDep ROOT node-red-contrib-opi-gpio@0.0.5 OK for: node-red-project@0.0.1 want: 0.0.5
36 silly fetch manifest onoff@1.1.*
37 http fetch GET 200 https://registry.npmjs.org/onoff 820ms (cache revalidated)
38 timing idealTree:#root Completed in 2490ms
39 silly placeDep ROOT onoff@1.1.9 OK for: node-red-contrib-opi-gpio@0.0.5 want: 1.1.*
40 silly fetch manifest epoll@~1.0.2
41 http fetch GET 200 https://registry.npmjs.org/epoll 90ms (cache revalidated)
42 timing idealTree:node_modules/node-red-contrib-opi-gpio Completed in 116ms
43 silly placeDep ROOT epoll@1.0.2 OK for: onoff@1.1.9 want: ~1.0.2
44 silly fetch manifest bindings@~1.3.0
45 silly fetch manifest nan@~2.8.0
46 http fetch GET 200 https://registry.npmjs.org/bindings 102ms (cache revalidated)
47 http fetch GET 200 https://registry.npmjs.org/nan 269ms (cache revalidated)
48 timing idealTree:node_modules/onoff Completed in 335ms
49 silly placeDep node_modules/epoll bindings@1.3.1 OK for: epoll@1.0.2 want: ~1.3.0
50 silly placeDep node_modules/epoll nan@2.8.0 OK for: epoll@1.0.2 want: ~2.8.0
51 timing idealTree:node_modules/epoll Completed in 21ms
52 timing idealTree:node_modules/epoll/node_modules/bindings Completed in 0ms
53 timing idealTree:node_modules/epoll/node_modules/nan Completed in 0ms
54 timing idealTree:buildDeps Completed in 2976ms
55 timing idealTree:fixDepFlags Completed in 63ms
56 timing idealTree Completed in 4370ms
57 timing reify:loadTrees Completed in 4376ms
58 timing reify:diffTrees Completed in 218ms
59 silly reify moves {}
60 timing reify:retireShallow Completed in 2ms
61 timing reify:createSparse Completed in 7ms
62 timing reify:trashOmits Completed in 1ms
63 timing reify:loadBundles Completed in 0ms
64 timing reifyNode:node_modules/epoll/node_modules/bindings Completed in 403ms
65 timing reifyNode:node_modules/node-red-contrib-opi-gpio Completed in 460ms
66 timing reifyNode:node_modules/epoll Completed in 533ms
67 timing reifyNode:node_modules/onoff Completed in 538ms
68 timing reifyNode:node_modules/epoll/node_modules/nan Completed in 570ms
69 timing reify:unpack Completed in 573ms
70 timing reify:unretire Completed in 0ms
71 timing build:queue Completed in 5ms
72 info run epoll@1.0.2 install node_modules/epoll node-gyp rebuild
73 info run epoll@1.0.2 install { code: 1, signal: null }
74 timing reify:rollback:createSparse Completed in 169ms
75 timing reify:rollback:retireShallow Completed in 0ms
76 timing command:install Completed in 17939ms
77 verbose stack Error: command failed
77 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
77 verbose stack     at ChildProcess.emit (events.js:314:20)
77 verbose stack     at maybeClose (internal/child_process.js:1022:16)
77 verbose stack     at Socket.<anonymous> (internal/child_process.js:444:11)
77 verbose stack     at Socket.emit (events.js:314:20)
77 verbose stack     at Pipe.<anonymous> (net.js:675:12)
78 verbose pkgid epoll@1.0.2
79 verbose cwd /home/millheim/.node-red
80 verbose Linux 4.19.63-sunxi64
81 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix=~" "--production" "node-red-contrib-opi-gpio@0.0.5"
82 verbose node v12.22.1
83 verbose npm  v7.19.0
84 error code 1
85 error path /home/millheim/.node-red/node_modules/epoll
86 error command failed
87 error command sh -c node-gyp rebuild
88 error make: Entering directory '/home/millheim/.node-red/node_modules/epoll/build'
88 error   CXX(target) Release/obj.target/epoll/src/epoll.o
88 error make: Leaving directory '/home/millheim/.node-red/node_modules/epoll/build'
89 error gyp info it worked if it ends with ok
89 error gyp info using node-gyp@7.1.2
89 error gyp info using node@12.22.1 | linux | arm64
89 error gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
89 error gyp info spawn /usr/bin/python3
89 error gyp info spawn args [
89 error gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
89 error gyp info spawn args   'binding.gyp',
89 error gyp info spawn args   '-f',
89 error gyp info spawn args   'make',
89 error gyp info spawn args   '-I',
89 error gyp info spawn args   '/home/millheim/.node-red/node_modules/epoll/build/config.gypi',
89 error gyp info spawn args   '-I',
89 error gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
89 error gyp info spawn args   '-I',
89 error gyp info spawn args   '/home/millheim/.cache/node-gyp/12.22.1/include/node/common.gypi',
89 error gyp info spawn args   '-Dlibrary=shared_library',
89 error gyp info spawn args   '-Dvisibility=default',
89 error gyp info spawn args   '-Dnode_root_dir=/home/millheim/.cache/node-gyp/12.22.1',
89 error gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
89 error gyp info spawn args   '-Dnode_lib_file=/home/millheim/.cache/node-gyp/12.22.1/<(target_arch)/node.lib',
89 error gyp info spawn args   '-Dmodule_root_dir=/home/millheim/.node-red/node_modules/epoll',
89 error gyp info spawn args   '-Dnode_engine=v8',
89 error gyp info spawn args   '--depth=.',
89 error gyp info spawn args   '--no-parallel',
89 error gyp info spawn args   '--generator-output',
89 error gyp info spawn args   'build',
89 error gyp info spawn args   '-Goutput_dir=.'
89 error gyp info spawn args ]
89 error gyp info spawn make
89 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
89 error In file included from ../node_modules/nan/nan_converters.h:67,
89 error                  from ../node_modules/nan/nan.h:202,
89 error                  from ../src/epoll.cc:15:
89 error ../node_modules/nan/nan_converters_43_inl.h: In static member function ‘static Nan::imp::ToFactoryBase<v8::Boolean>::return_t Nan::imp::ToFactory<v8::Boolean>::convert(v8::Local<v8::Value>)’:
89 error ../node_modules/nan/nan_converters_43_inl.h:18:69: warning: ‘v8::MaybeLocal<v8::Boolean> v8::Value::ToBoolean(v8::Local<v8::Context>) const’ is deprecated: ToBoolean can never throw. Use Local version. [-Wdeprecated-declarations]
89 error        val->To ## TYPE(v8::Isolate::GetCurrent()->GetCurrentContext())          \
89 error                                                                      ^
89 error ../node_modules/nan/nan_converters_43_inl.h:22:1: note: in expansion of macro ‘X’
89 error  X(Boolean)
89 error  ^
89 error In file included from /home/millheim/.cache/node-gyp/12.22.1/include/node/v8-internal.h:14,
89 error                  from /home/millheim/.cache/node-gyp/12.22.1/include/node/v8.h:27,
89 error                  from ../src/epoll.cc:11:
89 error /home/millheim/.cache/node-gyp/12.22.1/include/node/v8.h:2664:59: note: declared here
89 error                  V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean(
89 error                                                            ^~~~~~~~~
89 error /home/millheim/.cache/node-gyp/12.22.1/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
89 error    declarator __attribute__((deprecated(message)))
89 error    ^~~~~~~~~~
89 error In file included from ../node_modules/nan/nan_converters.h:67,
89 error                  from ../node_modules/nan/nan.h:202,
89 error                  from ../src/epoll.cc:15:
89 error ../node_modules/nan/nan_converters_43_inl.h: In static member function ‘static Nan::imp::ValueFactoryBase<bool>::return_t Nan::imp::ToFactory<bool>::convert(v8::Local<v8::Value>)’:
89 error ../node_modules/nan/nan_converters_43_inl.h:37:57: warning: ‘v8::Maybe<bool> v8::Value::BooleanValue(v8::Local<v8::Context>) const’ is deprecated: BooleanValue can never throw. Use Isolate version. [-Wdeprecated-declarations]
89 error    return val->NAME ## Value(isolate->GetCurrentContext());                     \
.
.
.
SNIP
.
.
.

89 error /home/millheim/.cache/node-gyp/12.22.1/include/node/node.h:770:3: note: in expansion of macro ‘NODE_MODULE_X’
89 error    NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
89 error    ^~~~~~~~~~~~~
89 error ../src/epoll.cc:381:1: note: in expansion of macro ‘NODE_MODULE’
89 error  NODE_MODULE(epoll, Epoll::Init)
89 error  ^~~~~~~~~~~
89 error In file included from ../src/epoll.cc:11:
89 error /home/millheim/.cache/node-gyp/12.22.1/include/node/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>&)]’:
89 error /home/millheim/.cache/node-gyp/12.22.1/include/node/node_object_wrap.h:85:78:   required from here
89 error /home/millheim/.cache/node-gyp/12.22.1/include/node/v8.h:10226: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]
89 error                 reinterpret_cast<Callback>(callback), type);
89 error                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89 error /home/millheim/.cache/node-gyp/12.22.1/include/node/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>&)]’:
89 error ../node_modules/nan/nan_object_wrap.h:66:61:   required from here
89 error /home/millheim/.cache/node-gyp/12.22.1/include/nObject; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
89 error ../node_modules/nan/nan_object_wrap.h:66:61:   required from here
89 error /home/millheim/.cache/node-gyp/12.22.1/include/node/v8.h:10226: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]
89 error make: *** [epoll.target.mk:113: Release/obj.target/epoll/src/epoll.o] Error 1
89 error gyp ERR! build error
89 error gyp ERR! stack Error: `make` failed with exit code: 2
89 error gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
89 error gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
89 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
89 error gyp ERR! System Linux 4.19.63-sunxi64
89 error gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
89 error gyp ERR! cwd /home/millheim/.node-red/node_modules/epoll
89 error gyp ERR! node -v v12.22.1
89 error gyp ERR! node-gyp -v v7.1.2
89 error gyp ERR! not ok
90 verbose exit 1

I did have some difficulty with package held messages during the re-install process but I thought I got past them in a way that was ok. I am not clear now on what step I took for that

when I do this:

npm i node-red-contrib-opi-gpio@0.0.7
or this:
npm i node-red-contrib-opi-gpio@0.0.5

I get this :

 added 1 package, changed 1 package, and audited 9 packages in 4s
   
   found 0 vulnerabilities

which seems ok. Reboot and or restart NR and opi nodes are not available (reloaded browser too) and the pallet manager does not show node-red-contrib-opi-gpio installed. This is what I get from command line:

$ npm list node-red-contrib-opi-gpio
millheim@1.0.0 /home/millheim
-- node-red-contrib-opi-gpio@0.0.7

Side note:
Link in palete manager for node - node-red-contrib-opi-gpio (node) - Node-RED still shows version as 0.0.5 whereas NPM link on that page to view at npmjs.com node-red-contrib-opi-gpio - npm shows 0.0.7

I had node-red-contrib-opi-gpio installed and working but I think some update broke something. I know, not very helpful but at this point I cant remember just when or what and am just trying to re-install all up-to-date (LTS versions preferred) and get working . The gpio is the last bit I need. I have been using 0.0.5 for a year or two just fine but now, I cant get that or the newest to work. I would like to have the ActiveLow pin mode in V0.0.7 but could live without if I must.

Any suggestions?

Did you do the ‘Additional Setup’ described in the node?

Thanks zenofmud. Short answer - yes. I checked that these changes all survived updates. Does something specific in the error logs suggest that I did something wrong in that section of instructions?

Q

It looks as if you are running that from the wrong folder. You should run it from your .node-red folder. Also when installing nodes from the command line you must run the npm command from your .node-red folder.

Thank you Colin. Granting that you are correct, how should I clean up the mess? Is there a mess? This seems an excellent opportunity to leave files etc. laying around in the wrong places that I fall over later...

Delete the node_modules folder from where you ran the install previously.
Also package.json and package-lock.json from there.

Thanks Colin. I was hoping cleanup would be that straightforward. Using your guidance I was able to get the node up and working in short order. Now for cleanup...

Q

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