dangrie158 / opencushion

A c++ driver and a node binding for the HX711 Load Cell Amp
MIT License
14 stars 17 forks source link

Build Error #7

Open nathanziarek opened 6 years ago

nathanziarek commented 6 years ago

Followed the directions to install g++ 4.8 as well as wiringPi, but still having issues installing this node component.

I'm not competent enough in this type of software to understand what's going on, although nothing jumps out at me. I'd guess it's a node-gyp issue, which another user mentioned, but I don't understand how to implement his proposed solution

pi@raspberrypi:~/Source/node-hx711 $ npm install hx711 --save

> hx711@0.3.0 install /home/pi/Source/node-hx711/node_modules/hx711
> node-gyp rebuild

make: Entering directory '/home/pi/Source/node-hx711/node_modules/hx711/build'
  CXX(target) Release/obj.target/hx711/binding.o
../binding.cpp: In static member function ‘static void HX711Wrapper::New(const v8::FunctionCallbackInfo<v8::Value>&)’:
../binding.cpp:159:61: error: no matching function for call to ‘v8::Function::NewInstance(const int&, v8::Local<v8::Value> [2])’
       args.GetReturnValue().Set(cons->NewInstance(argc, argv));
                                                             ^
../binding.cpp:159:61: note: candidates are:
In file included from /home/pi/.node-gyp/10.9.0/include/node/node.h:63:0,
                 from ../binding.h:1,
                 from ../binding.cpp:1:
/home/pi/.node-gyp/10.9.0/include/node/v8.h:3976:44: note: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^
/home/pi/.node-gyp/10.9.0/include/node/v8.h:3976:44: note:   candidate expects 3 arguments, 2 provided
/home/pi/.node-gyp/10.9.0/include/node/v8.h:3979:44: note: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                            ^
/home/pi/.node-gyp/10.9.0/include/node/v8.h:3979:44: note:   candidate expects 1 argument, 2 provided
hx711.target.mk:98: recipe for target 'Release/obj.target/hx711/binding.o' failed
make: *** [Release/obj.target/hx711/binding.o] Error 1
make: Leaving directory '/home/pi/Source/node-hx711/node_modules/hx711/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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:239:12)
gyp ERR! System Linux 4.14.50+
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/Source/node-hx711/node_modules/hx711
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
npm WARN testing-hx711@1.0.0 No description
npm WARN testing-hx711@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hx711@0.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the hx711@0.3.0 install 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/2018-08-29T19_15_53_463Z-debug.log
arronhunt commented 5 years ago

I'm also seeing this error on install.

> node -v
v11.6.0
> npm  -v
6.5.0
t0m82 commented 5 years ago

I'm facing the same error too. Any solution for that yet?

makander commented 4 years ago

I just managed to get this to work by using v8 of node. npm install -g n n v8.16.1

Edit: https://raspberrypi.stackexchange.com/a/101115 <- Instructions for installing g++ 4.8, in case anyone needs that too.