Closed gregoryz7 closed 8 years ago
I will look into it, but it seems like the file compiles fine except for the Nan::SetAccessor() method in initAddon(). Some version issues? I used Nan version 2.3.3. I see there is a 2.3.5 version out now...
Actually, the two getters width and height which caused the problem wasn't used. A new version is available, try it now.
Hi Thanks for the prompt response! I was getting build issues still so i thought maybe it was related to the Makefile not having a pinout mode uncommented so I went through and tried to rebuild the module without npm and the make operation fails with:
pi@raspberrypi:~/hzeller-matrix-example$ sudo make -C hzeller/lib && node-gyp rebuild make: *\ hzeller/lib: No such file or directory. Stop. pi@raspberrypi:~/hzeller-matrix-example$ sudo make -C /home/pi/hzeller-matrix- example/node_modules/hzeller/lib && node-gyp rebuild make: Entering directory '/home/pi/hzeller-matrix-example/node_modules/hzeller /lib' g++ -I../include -Wall -O3 -g -fPIC -DADAFRUIT_RGBMATRIX_HAT -c -o gpio.o gpio .cc g++ -I../include -Wall -O3 -g -fPIC -DADAFRUIT_RGBMATRIX_HAT -c -o led-matrix. o led-matrix.cc g++ -I../include -Wall -O3 -g -fPIC -DADAFRUIT_RGBMATRIX_HAT -c -o framebuffer .o framebuffer.cc g++ -I../include -Wall -O3 -g -fPIC -DADAFRUIT_RGBMATRIX_HAT -c -o thread.o th read.cc g++ -I../include -Wall -O3 -g -fPIC -DADAFRUIT_RGBMATRIX_HAT -c -o bdf-font.o bdf-font.cc g++ -I../include -Wall -O3 -g -fPIC -DADAFRUIT_RGBMATRIX_HAT -c -o graphics.o graphics.cc g++ -I../include -Wall -O3 -g -fPIC -DADAFRUIT_RGBMATRIX_HAT -c -o transformer .o transformer.cc ar rcs librgbmatrix.a gpio.o led-matrix.o framebuffer.o thread.o bdf-font.o gr aphics.o transformer.o make: Leaving directory '/home/pi/hzeller-matrix-example/node_modules/hzeller/ lib' gyp info it worked if it ends with ok gyp info using node-gyp@3.3.1 gyp info using node@0.10.29 | linux | arm gyp http GET https://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz gyp http 200 https://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz gyp http GET https://nodejs.org/dist/v0.10.29/SHASUMS256.txt gyp http 200 https://nodejs.org/dist/v0.10.29/SHASUMS256.txt gyp info spawn /usr/bin/python2 gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/home/pi/hzeller-matrix-example/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/local/lib/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/home/pi/.node-gyp/0.10.29/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/home/pi/.node-gyp/0.10.29', gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=node.lib', gyp info spawn args '-Dmodule_root_dir=/home/pi/hzeller-matrix-example', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' ] gyp: binding.gyp not found (cwd: /home/pi/hzeller-matrix-example) while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error:
gyp
failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/node- gyp/lib/configure.js:305:16) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:80 9:12) gyp ERR! System Linux 4.4.11-v7+ gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild" gyp ERR! cwd /home/pi/hzeller-matrix-example gyp ERR! node -v v0.10.29 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok
I've never used gyp so maybe you can give me a pointer? I also tried using npm and I got the original error again i think.. I will try building with the older version of Nan ( i dont know if that would help)
I erased my Pi and did the following:
$ git clone https://github.com/meg768/hzeller-matrix-example.git
$ cd heller-matrix-example
$ npm install
$ sudo node app.js --rain
It worked fine. My versions of things are:
$ uname -a
Linux raspberrypi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux
$ node --version
v5.11.1
$ g++ --version
g++ (Raspbian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ node-gyp --version
v3.3.1
Install a later version of Node? Can't think of anything else at the moment. :(
BTW, it seems like you are using the AdaFruit Hat. It works but you should try the new pinout. It really makes a difference. https://oshpark.com/shared_projects/QIA9YHZH
Just a heads up. I managed to get it running this morning. I will explain later. Thanks!
Great news! :)
Starting from the absolute beginning for debugging purposes and so someone else can follow along (myself... later on)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
sudo apt-get install libgraphicsmagick++1-dev
sudo apt-get install libwebp-dev
(this was related to one error)curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
(i had done sudo apt-get install nodejs before and evidentally it doesnt give you what you need, this works better! I believe npm is also installed with this)git clone https://github.com/meg768/hzeller-matrix-example.git
cd hzeller-matrix-example
npm install
sudo nano node_modules/hzeller-matrix/hzeller/lib/Makefile
(add changes if you are using the classic pinout or a hat here)make clean -C node_modules/hzeller-matrix/hzeller/lib
npm rebuild
I had a bunch of other issues but they were related to the nodejs installation method and not your module. Using aptitude it still throws an error without installing libwebp-dev. Thanks for your patience!
I keep getting this while trying to install this module:
gyp verb architecture arm gyp verb node dev dir /root/.node-gyp/0.10.29 gyp verb (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:242:16)
npm verb stack at EventEmitter.emit (events.js:98:17)
npm verb stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
npm verb stack at ChildProcess.emit (events.js:98:17)
npm verb stack at maybeClose (child_process.js:755:16)
npm verb stack at Process.ChildProcess._handle.onexit (child_process.js:822:5)
npm verb pkgid hzeller-matrix@1.0.23
npm verb cwd /home/pi
npm ERR! Linux 4.4.11-v7+
npm ERR! argv "node" "/usr/local/bin/npm" "i" "-g" "hzeller-matrix" "--unsafe-perm" "--verbose"
npm ERR! node v0.10.29
npm ERR! npm v3.10.2
npm ERR! code ELIFECYCLE
which
succeeded formake
/usr/bin/make gyp info spawn make gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory '/usr/lib/node_modules/hzeller-matrix/build' g++ '-DNODE_GYP_MODULE_NAME=hzeller-matrix' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/0.10.29/include/node -I/root/.node-gyp/0.10.29/src -I/root/.node-gyp/0.10.29/deps/uv/include -I/root/.node-gyp/0.10.29/deps/v8/include -I/usr/include/GraphicsMagick -I../hzeller/include -I../node_modules/nan -fPIC -Wall -pthread -Wall -O3 -g -O2 -fno-strict-aliasing -fno-tree-vrp -Wall -g -fno-strict-aliasing -O2 -pthread -I/usr/include/GraphicsMagick -MMD -MF ./Release/.deps/Release/obj.target/hzeller-matrix/src/addon.o.d.raw -c -o Release/obj.target/hzeller-matrix/src/addon.o ../src/addon.cpp ../src/addon.cpp: In function ‘void initAddon(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’: ../src/addon.cpp:264:79: error: no matching function for call to ‘SetAccessor(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE&, v8::Localv8::String, Nan::NAN_GETTER_RETURN_TYPE (&)(v8::Localv8::String, Nan::NAN_GETTER_ARGS_TYPE))’ Nan::SetAccessor(target, Nan::New("width").ToLocalChecked(), Addon::getWidth); ^ ../src/addon.cpp:264:79: note: candidates are: In file included from ../src/includes.h:4:0, from ../src/addon.h:5, from ../src/addon.cpp:2: ../node_modules/nan/nan.h:1906:13: note: void Nan::SetAccessor(v8::Localv8::ObjectTemplate, v8::Localv8::String, Nan::GetterCallback, Nan::SetterCallback, v8::Localv8::Value, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig) inline void SetAccessor( ^ ../node_modules/nan/nan.h:1906:13: note: no known conversion for argument 1 from ‘Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE {aka v8::Handlev8::Object}’ to ‘v8::Localv8::ObjectTemplate’ ../node_modules/nan/nan.h:1950:13: note: bool Nan::SetAccessor(v8::Localv8::Object, v8::Localv8::String, Nan::GetterCallback, Nan::SetterCallback, v8::Localv8::Value, v8::AccessControl, v8::PropertyAttribute) inline bool SetAccessor( ^ ../node_modules/nan/nan.h:1950:13: note: no known conversion for argument 1 from ‘Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE {aka v8::Handlev8::Object}’ to ‘v8::Localv8::Object’ ../src/addon.cpp:265:80: error: no matching function for call to ‘SetAccessor(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE&, v8::Localv8::String, Nan::NAN_GETTER_RETURN_TYPE (&)(v8::Localv8::String, Nan::NAN_GETTER_ARGS_TYPE))’ Nan::SetAccessor(target, Nan::New("height").ToLocalChecked(), Addon::getHeight); ^ ../src/addon.cpp:265:80: note: candidates are: In file included from ../src/includes.h:4:0, from ../src/addon.h:5, from ../src/addon.cpp:2: ../node_modules/nan/nan.h:1906:13: note: void Nan::SetAccessor(v8::Localv8::ObjectTemplate, v8::Localv8::String, Nan::GetterCallback, Nan::SetterCallback, v8::Localv8::Value, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig) inline void SetAccessor( ^ ../node_modules/nan/nan.h:1906:13: note: no known conversion for argument 1 from ‘Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE {aka v8::Handlev8::Object}’ to ‘v8::Localv8::ObjectTemplate’ ../node_modules/nan/nan.h:1950:13: note: bool Nan::SetAccessor(v8::Localv8::Object, v8::Localv8::String, Nan::GetterCallback, Nan::SetterCallback, v8::Localv8::Value, v8::AccessControl, v8::PropertyAttribute) inline bool SetAccessor( ^ ../node_modules/nan/nan.h:1950:13: note: no known conversion for argument 1 from ‘Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE {aka v8::Handlev8::Object}’ to ‘v8::Localv8::Object’ hzeller-matrix.target.mk:92: recipe for target 'Release/obj.target/hzeller-matrix/src/addon.o' failed make: *\ [Release/obj.target/hzeller-matrix/src/addon.o] Error 1 make: Leaving directory '/usr/lib/node_modules/hzeller-matrix/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 ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12) gyp ERR! System Linux 4.4.11-v7+ gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/lib/node_modules/hzeller-matrix gyp ERR! node -v v0.10.29 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok npm verb lifecycle hzeller-matrix@1.0.23~install: unsafe-perm in lifecycle true npm verb lifecycle hzeller-matrix@1.0.23~install: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/lib/node_modules/hzeller-matrix/node_modules/.bin:/usr/lib/node_modules/.bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin npm verb lifecycle hzeller-matrix@1.0.23~install: CWD: /usr/lib/node_modules/hzeller-matrix npm info lifecycle hzeller-matrix@1.0.23~install: Failed to exec install script npm verb unlock done using /root/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging npm verb stack Error: hzeller-matrix@1.0.23 install:make -C hzeller/lib && node-gyp rebuild
npm verb stack Exit status 1 npm verb stack at EventEmitter.npm ERR! hzeller-matrix@1.0.23 install:
make -C hzeller/lib && node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the hzeller-matrix@1.0.23 install script 'make -C hzeller/lib && node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the hzeller-matrix package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! make -C hzeller/lib && node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs hzeller-matrix npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls hzeller-matrix npm ERR! There is likely additional logging output above. npm verb exit [ 1, true ]npm ERR! Please include the following file with any support request: npm ERR! /home/pi/npm-debug.log
any help would be great, Thanks, @meg768