BPI M1 A20 problem when trying to install HAP-NodeJS

Hello guys,

I just purchased a BPI with A20 chip, and I mostly want to use it as a NAS and torrent downloader (I already have a 4TB WD NAS) but also for some home automation.

Now I wanted to install everything is needed to play with Apple Homekit, I also have a few ESP8266 boards that I want to use to turn on or off some lights and devices, but it fails to install HAP-NodeJS

I first tried bananian OS and reached the same error while tryign to download something from amazon, than I installed 2016-07-13-raspbian-jessie-bpi-m1-m1p-r1.img and tried again by following this tutorial

When I runed this coomand, after installing node-persist correctly it failed on the next module

npm install node-persist && npm install srp && npm install mdns && npm install ed25519 && npm install curve25519 && npm install debug && npm install python-shell

The error is :

root@bpi-iot-ros-ai:/home/pi/HAP-NodeJS# npm install srp

[email protected] install /home/pi/HAP-NodeJS/node_modules/bignum node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https://rvagg-node.s3-us-west-2.amazonaws.com/bignum/v0.12.5/bignum-v0.12.5-node-v47-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v47 ABI) (falling back to source compile with node-gyp)

also tried to install manually one by one, when I tried to install curve25519 I got again some errors

ANYONE AROUND TO SHOW ME THE PATH :slight_smile: ?

root@bpi-iot-ros-ai:/home/pi/HAP-NodeJS# npm install curve25519

[email protected] install /home/pi/HAP-NodeJS/node_modules/curve25519 node-gyp rebuild

make: Entering directory ‘/home/pi/HAP-NodeJS/node_modules/curve25519/build’ CXX(target) Release/obj.target/curve25519/curve25519.o …/curve25519.cc: In function ‘v8::Handlev8::Value V8Exception(const char*)’: …/curve25519.cc:14:44: error: ‘New’ is not a member of ‘v8::String’ return ThrowException(Exception::Error(String::New(msg))); ^ …/curve25519.cc:14:61: error: ‘ThrowException’ was not declared in this scope return ThrowException(Exception::Error(String::New(msg))); ^ …/curve25519.cc: At global scope: …/curve25519.cc:18:51: error: ‘Arguments’ does not name a type static Handle node_curve25519_donna (const Arguments& args) { ^ In file included from /root/.node-gyp/5.2.0/include/node/node.h:42:0, from …/curve25519.cc:1: /root/.node-gyp/5.2.0/include/node/v8.h: In function ‘v8::Handlev8::Value node_curve25519_donna(const int&)’: /root/.node-gyp/5.2.0/include/node/v8.h:889:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ …/curve25519.cc:19:15: error: within this context HandleScope scope; ^ …/curve25519.cc:23:12: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’ if (args.Length() < 2) { ^ …/curve25519.cc:29:29: error: invalid types ‘const int[int]’ for array subscript if( (Buffer::Length(args[0]->ToObject()) != 32) || ^ …/curve25519.cc:30:29: error: invalid types ‘const int[int]’ for array subscript (Buffer::Length(args[1]->ToObject()) != 32) ) { ^ …/curve25519.cc:35:9: error: expected primary-expression before ‘’ token Buffer publicKey = Buffer::New(32); ^ …/curve25519.cc:35:11: error: ‘publicKey’ was not declared in this scope Buffer* publicKey = Buffer::New(32); ^ …/curve25519.cc:35:37: error: no matching function for call to ‘New(int)’ Buffer* publicKey = Buffer::New(32); ^ …/curve25519.cc:35:37: note: candidates are: In file included from …/curve25519.cc:2:0: /root/.node-gyp/5.2.0/include/node/node_buffer.h:28:40: note: v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate*, size_t) NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate* isolate, size_t length); ^ /root/.node-gyp/5.2.0/include/node/node_buffer.h:28:40: note: candidate expects 2 arguments, 1 provided /root/.node-gyp/5.2.0/include/node/node_buffer.h:31:40: note: v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate*, v8::Localv8::String, node::encoding) NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate* isolate, ^ /root/.node-gyp/5.2.0/include/node/node_buffer.h:31:40: note: candidate expects 3 arguments, 1 provided /root/.node-gyp/5.2.0/include/node/node_buffer.h:36:40: note: v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate*, char*, size_t, node::Buffer::FreeCallback, void*) NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate* isolate, ^ /root/.node-gyp/5.2.0/include/node/node_buffer.h:36:40: note: candidate expects 5 arguments, 1 provided /root/.node-gyp/5.2.0/include/node/node_buffer.h:43:40: note: v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate*, char*, size_t) NODE_EXTERN v8::MaybeLocalv8::Object New(v8::Isolate* isolate, ^ /root/.node-gyp/5.2.0/include/node/node_buffer.h:43:40: note: candidate expects 3 arguments, 1 provided …/curve25519.cc:37:46: error: invalid types ‘const int[int]’ for array subscript u8* privateKey = (u8*) Buffer::Data(args[0]->ToObject()); ^ …/curve25519.cc:38:45: error: invalid types ‘const int[int]’ for array subscript u8* basePoint = (u8*) Buffer::Data(args[1]->ToObject()); ^ …/curve25519.cc:42:18: error: ‘class v8::HandleScope’ has no member named ‘Close’ return scope.Close(Local::New(publicKey->handle_)); ^ …/curve25519.cc:44:18: error: ‘class v8::HandleScope’ has no member named ‘Close’ return scope.Close(Null()); ^ …/curve25519.cc:44:29: error: too few arguments to function ‘v8::Localv8::Primitive v8::Null(v8::Isolate*)’ return scope.Close(Null()); ^ In file included from /root/.node-gyp/5.2.0/include/node/node.h:42:0, from …/curve25519.cc:1: /root/.node-gyp/5.2.0/include/node/v8.h:316:27: note: declared here friend Local Null(Isolate* isolate); ^ …/curve25519.cc: At global scope: …/curve25519.cc:49:28: error: ‘Arguments’ does not name a type Handle Random(const Arguments& args) { ^ In file included from /root/.node-gyp/5.2.0/include/node/node.h:42:0, from …/curve25519.cc:1: /root/.node-gyp/5.2.0/include/node/v8.h: In function ‘v8::Handlev8::Value Random(const int&)’: /root/.node-gyp/5.2.0/include/node/v8.h:889:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ …/curve25519.cc:54:17: error: within this context HandleScope scope; ^ …/curve25519.cc:59:18: error: ‘class v8::HandleScope’ has no member named ‘Close’ return scope.Close( ^ …/curve25519.cc:62:32: error: no matching function for call to ‘v8::Integer::New(int)’ Integer::New(rand() % 2) ^ …/curve25519.cc:62:32: note: candidate is: In file included from /root/.node-gyp/5.2.0/include/node/node.h:42:0, from …/curve25519.cc:1: /root/.node-gyp/5.2.0/include/node/v8.h:2496:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate*, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/5.2.0/include/node/v8.h:2496:25: note: candidate expects 2 arguments, 1 provided …/curve25519.cc: In function ‘void RegisterModule(v8::Handlev8::Object)’: …/curve25519.cc:70:17: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol(“random”), ^ …/curve25519.cc:71:37: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handlev8::Value (&)(const int&))’ FunctionTemplate::New(Random)->GetFunction()); ^ …/curve25519.cc:71:37: note: candidate is: In file included from /root/.node-gyp/5.2.0/include/node/node.h:42:0, from …/curve25519.cc:1: /root/.node-gyp/5.2.0/include/node/v8.h:4348:34: note: static v8::Localv8::FunctionTemplate v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Localv8::Value, v8::Localv8::Signature, int) static Local New( ^ /root/.node-gyp/5.2.0/include/node/v8.h:4348:34: note: no known conversion for argument 1 from ‘v8::Handlev8::Value(const int&) {aka v8::Localv8::Value(const int&)}’ to ‘v8::Isolate*’ …/curve25519.cc:73:17: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol(“curve25519_donna”), ^ …/curve25519.cc:74:56: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handlev8::Value (&)(const int&))’ FunctionTemplate::New(node_curve25519_donna)->GetFunction()); ^ …/curve25519.cc:74:56: note: candidate is: In file included from /root/.node-gyp/5.2.0/include/node/node.h:42:0, from …/curve25519.cc:1: /root/.node-gyp/5.2.0/include/node/v8.h:4348:34: note: static v8::Localv8::FunctionTemplate v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Localv8::Value, v8::Localv8::Signature, int) static Local New( ^ /root/.node-gyp/5.2.0/include/node/v8.h:4348:34: note: no known conversion for argument 1 from ‘v8::Handlev8::Value(const int&) {aka v8::Localv8::Value(const int&)}’ to ‘v8::Isolate*’ …/curve25519.cc: In function ‘v8::Handlev8::Value Random(const int&)’: …/curve25519.cc:64:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ curve25519.target.mk:85: recipe for target ‘Release/obj.target/curve25519/curve25519.o’ failed make: *** [Release/obj.target/curve25519/curve25519.o] Error 1 make: Leaving directory ‘/home/pi/HAP-NodeJS/node_modules/curve25519/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:270:23) gyp ERR! stack at emitTwo (events.js:88:13) gyp ERR! stack at ChildProcess.emit (events.js:173:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:201:12) gyp ERR! System Linux 3.4.112-sun7i 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/HAP-NodeJS/node_modules/curve25519 gyp ERR! node -v v5.2.0 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok npm ERR! Linux 3.4.112-sun7i npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “curve25519” npm ERR! node v5.2.0 npm ERR! npm v3.3.12 npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script ‘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 curve25519 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 their info via: npm ERR! npm owner ls curve25519 npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/HAP-NodeJS/npm-debug.log