Error on npm install node-red-node-grovepi

234 views
Skip to first unread message

Thomas Meier

unread,
Jan 21, 2017, 7:55:23 PM1/21/17
to Node-RED
I try to install node-red-node-grovepi on my RPi3 but the installation keeps failing with the error below. I followed the instructions and downgraded npm to v2.15.11 but still no success. node.js is at v6.9.4.

I have another node.js project using node-grovepi (and npm V3) that can access the grove sensors, but no success for node-red.
Already tried installing node-grovepi in .nod-red and globally but did not help either.
Also tried installation through node-red Manage palette and tried the other two grovepi related packages. None of them install.
So now I'm at my wits end. What could be the cause for the installation to fail?
 


pi@greenpi:~/.node-red $ /usr/local/bin/npm install node-red-node-grovepi
\
> i2c-bus@0.11.3 install /home/pi/.node-red/node_modules/node-red-node-grovepi/node_modules/node-grovepi/node_modules/i2c-bus
> node-gyp rebuild

make
: Entering directory '/home/pi/.node-red/node_modules/node-red-node-grovepi/node_modules/node-grovepi/node_modules/i2c-bus/build'
  CXX
(target) Release/obj.target/i2c/src/i2c.o
In file included from ../../../../../../nan/nan.h:182:0,
                 
from ../src/i2c.cc:2:
../../../../../../nan/nan_maybe_43_inl.h: In function Nan::MaybeLocal<v8::Object> Nan::CloneElementAt(v8::Local<v8::Array>, uint32_t)’:
../../../../../../nan/nan_maybe_43_inl.h:221:58: warning: v8::MaybeLocal<v8::Object> v8::Array::CloneElementAt(v8::Local<v8::Context>, uint32_t)’ is deprecated (declared at /home/pi/.node-gyp/6.9.4/include/node/v8.h:3031): Cloning is not supported. [-Wdeprecated-declarations]
   
return array->CloneElementAt(GetCurrentContext(), index);
                                                         
^
In file included from ../../../../../../nan/nan_new.h:189:0,
                 
from ../../../../../../nan/nan.h:188,
                 
from ../src/i2c.cc:2:
../../../../../../nan/nan_implementation_12_inl.h: In static member function static Nan::imp::FactoryBase<v8::BooleanObject>::return_t Nan::imp::Factory<v8::BooleanObject>::New(bool)’:
../../../../../../nan/nan_implementation_12_inl.h:40:38: warning: static v8::Local<v8::Value> v8::BooleanObject::New(bool)’ is deprecated (declared at /home/pi/.node-gyp/6.9.4/include/node/v8.h:4007): Pass an isolate [-Wdeprecated-declarations]
   
return v8::BooleanObject::New(value).As<v8::BooleanObject>();
                                     
^
In file included from ../src/i2c.cc:2:0:
../../../../../../nan/nan.h: At global scope:
../../../../../../nan/nan.h:590:20: error: variable or field AddGCEpilogueCallback declared void
       v8
::Isolate::GCEpilogueCallback callback
                   
^
../../../../../../nan/nan.h:590:7: error: GCEpilogueCallback is not a member of v8::Isolate
       v8
::Isolate::GCEpilogueCallback callback
       
^
../../../../../../nan/nan.h:591:18: error: expected primary-expression before gc_type_filter
     
, v8::GCType gc_type_filter = v8::kGCTypeAll) {
                 
^
../../../../../../nan/nan.h:596:20: error: variable or field RemoveGCEpilogueCallback declared void
       v8
::Isolate::GCEpilogueCallback callback) {
                   
^
../../../../../../nan/nan.h:596:7: error: GCEpilogueCallback is not a member of v8::Isolate
       v8
::Isolate::GCEpilogueCallback callback) {
       
^
../../../../../../nan/nan.h:601:20: error: variable or field AddGCPrologueCallback declared void
       v8
::Isolate::GCPrologueCallback callback
                   
^
../../../../../../nan/nan.h:601:7: error: GCPrologueCallback is not a member of v8::Isolate
       v8
::Isolate::GCPrologueCallback callback
       
^
../../../../../../nan/nan.h:602:18: error: expected primary-expression before gc_type_filter
     
, v8::GCType gc_type_filter = v8::kGCTypeAll) {
                 
^
../../../../../../nan/nan.h:607:20: error: variable or field RemoveGCPrologueCallback declared void
       v8
::Isolate::GCPrologueCallback callback) {
                   
^
../../../../../../nan/nan.h:607:7: error: GCPrologueCallback is not a member of v8::Isolate
       v8
::Isolate::GCPrologueCallback callback) {
       
^
../../../../../../nan/nan.h: In function bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../../../../../../nan/nan.h:1933:16: warning: bool v8::Object::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’ is deprecated (declared at /home/pi/.node-gyp/6.9.4/include/node/v8.h:2750): Use maybe version [-Wdeprecated-declarations]
     
, attribute);
               
^
i2c
.target.mk:94: recipe for target 'Release/obj.target/i2c/src/i2c.o' failed
make
: *** [Release/obj.target/i2c/src/i2c.o] Error 1
make
: Leaving directory '/home/pi/.node-red/node_modules/node-red-node-grovepi/node_modules/node-grovepi/node_modules/i2c-bus/build'
gyp ERR
! build error
gyp ERR
! stack Error: `make` failed with exit code: 2
gyp ERR
! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR
! stack     at emitTwo (events.js:106:13)
gyp ERR
! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR
! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR
! System Linux 4.4.38-v7+
gyp ERR
! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR
! cwd /home/pi/.node-red/node_modules/node-red-node-grovepi/node_modules/node-grovepi/node_modules/i2c-bus
gyp ERR
! node -v v6.9.4
gyp ERR
! node-gyp -v v3.4.0
gyp ERR
! not ok
npm ERR
! Linux 4.4.38-v7+
npm ERR
! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node-red-node-grovepi"
npm ERR
! node v6.9.4
npm ERR
! npm  v2.15.11
npm ERR
! code ELIFECYCLE

npm ERR
! i2c-bus@0.11.3 install: `node-gyp rebuild`
npm ERR
! Exit status 1
npm ERR
!
npm ERR
! Failed at the i2c-bus@0.11.3 install script 'node-gyp rebuild'.
npm ERR
! This is most likely a problem with the i2c-bus package,
npm ERR
! not with npm itself.
npm ERR
! Tell the author that this fails on your system:
npm ERR
!     node-gyp rebuild
npm ERR
! You can get information on how to open an issue for this project with:
npm ERR
!     npm bugs i2c-bus
npm ERR
! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls i2c-bus
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/pi/.node-red/npm-debug.log
pi@greenpi:~/.node-red $



Dave C-J

unread,
Jan 22, 2017, 5:53:17 AM1/22/17
to node...@googlegroups.com
Ah, right... the author needs to bump his dependancy on node-grovepi to be more recent...
hopefully he will fix fairly quick.
If not you can clone his package and change the dependency to be ^2.1.1
and then reinstall it.
Message has been deleted

Thomas Meier

unread,
Jan 22, 2017, 7:57:25 AM1/22/17
to Node-RED
thanks for opening the issue for me.
I figured out how to clone the repo, modify package.json and install it from that path. Now it installed and my temp/humi reading is working. Not sure how i can change the sensor type from default DHT11 to DHT22 thou. node-grovepi offers a moduleType parameter for DHTDigitalSensor but I could not find that parameter in node-red. But I guess that question is to be directed at jpwsutton as well right?

Dave C-J

unread,
Jan 22, 2017, 8:38:43 AM1/22/17
to node...@googlegroups.com
​Well done you ! - yes - may as well ask him. I'm not familiar with Grove myself, though someone else here may have a clue.​

Dave C-J

unread,
Jan 22, 2017, 11:10:26 AM1/22/17
to node...@googlegroups.com
looking into the node-grovepi code it looks like the options are as below, so you could (for now at least) hack line 107 of James's 
GrovePiBoard.js code to be
var dhtSensor = new GrovePi.sensors.DHTDigital(pin,1);
and of course if that doesn't work... I'm outta here ;-)

DHTDigitalSensor.VERSION = {
'DHT11' : 0
, 'DHT22' : 1
, 'DHT21' : 2
, 'AM2301': 3
}

James Sutton

unread,
Jan 23, 2017, 5:53:50 AM1/23/17
to Node-RED
Hi, I've updated the dependency and have published the change to npm, so you should be able to compile now. 

Also, if you could create an enhancement request here for the DHT-22 here: https://github.com/jpwsutton/node-red-node-grovepi/issues/new I'll be happy to add it in :)
Reply all
Reply to author
Forward
0 new messages