justmoon / node-blync

Blynclight module for Node.js using node-hid
13 stars 5 forks source link

Issues with Ubuntu docker image #2

Open TylerLeonhardt opened 7 years ago

TylerLeonhardt commented 7 years ago

Hi there,

Not sure if this is possible but I attempted to install this in an ubuntu docker container on macOS.

I received the following error:

# ls
    Dockerfile  LICENSE  README.md  app.js  node_modules  package-lock.json  package.json
# clear
# npm install blync
npm info it worked if it ends with ok
npm info using npm@5.0.3
npm info using node@v8.1.2
npm http fetch GET 200 https://registry.npmjs.org/blync 37ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/node-hid 8ms (from cache)
npm info lifecycle blync@1.0.0~preinstall: blync@1.0.0
npm info lifecycle node-hid@0.3.2~preinstall: node-hid@0.3.2

> node-hid@0.3.2 preinstall /usr/mtn/app/node_modules/node-hid
> sh get-hidapi.sh

Cloning into 'hidapi'...
remote: Counting objects: 2006, done.
remote: Total 2006 (delta 0), reused 0 (delta 0), pack-reused 2006
Receiving objects: 100% (2006/2006), 2.72 MiB | 0 bytes/s, done.  Receiving objects: 100% (2006/2006)
Resolving deltas: 100% (1174/1174), done.       Resolving deltas:   0% (0/1174)
Checking connectivity... done.
npm info linkStuff blync@1.0.0
npm info linkStuff node-hid@0.3.2
npm info lifecycle blync@1.0.0~install: blync@1.0.0
npm info lifecycle node-hid@0.3.2~install: node-hid@0.3.2

> node-hid@0.3.2 install /usr/mtn/app/node_modules/node-hid
> sh install.sh

gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.1.2 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/local/lib/node_modules/npm/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   '/usr/mtn/app/node_modules/node-hid/build/config.gypi',
    gyp info spawn args   '-I',
       gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
   gyp info spawn args   '/root/.node-gyp/8.1.2/include/node/common.gypi',
    gyp info spawn args   '-Dlibrary=shared_library',
     gyp info spawn args   '-Dvisibility=default',
  gyp info spawn args   '-Dnode_root_dir=/root/.node-gyp/8.1.2',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
       gyp info spawn args   '-Dnode_lib_file=/root/.node-gyp/8.1.2/<(target_arch)/node.lib',
     gyp info spawn args   '-Dmodule_root_dir=/usr/mtn/app/node_modules/node-hid',
  gyp info spawn args   '-Dnode_engine=v8',
   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=.' ]
      make: Entering directory '/usr/mtn/app/node_modules/node-hid/build'
 gyp info spawn make
      gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/hidapi/hidapi/libusb/hid.o
  ../hidapi/libusb/hid.c: In function 'hid_read_timeout':
 ../hidapi/libusb/hid.c:1078:6: warning: variable 'bytes_read' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
   int bytes_read = -1;
     ^
AR(target) Release/obj.target/hidapi.a
COPY Release/hidapi.a
       CXX(target) Release/obj.target/HID/src/HID.o
   ../src/HID.cc: In member function 'virtual v8::Handle<v8::Value> JSException::asV8Exception() const':
  ../src/HID.cc:50:71: error: 'New' is not a member of 'v8::String'
      virtual Handle<Value> asV8Exception() const { return ThrowException(String::New(message().c_str())); }
   ^
      ../src/HID.cc:50:101: error: 'ThrowException' was not declared in this scope
     virtual Handle<Value> asV8Exception() const { return ThrowException(String::New(message().c_str())); }
  ^
   ../src/HID.cc: At global scope:
  ../src/HID.cc:58:1: error: expected class-name before '{' token
  {
    ^
     ../src/HID.cc:61:38: error: 'Arguments' does not name a type
      static Handle<Value> devices(const Arguments& args);
^
 ../src/HID.cc:76:34: error: 'Arguments' does not name a type
static Handle<Value> New(const Arguments& args);
    ^
     ../src/HID.cc:77:35: error: 'Arguments' does not name a type
    static Handle<Value> read(const Arguments& args);
^
 ../src/HID.cc:78:36: error: 'Arguments' does not name a type
  static Handle<Value> write(const Arguments& args);
^
 ../src/HID.cc:79:36: error: 'Arguments' does not name a type
static Handle<Value> close(const Arguments& args);
      ^
 ../src/HID.cc:80:45: error: 'Arguments' does not name a type
static Handle<Value> setNonBlocking(const Arguments& args);
^
 ../src/HID.cc:81:47: error: 'Arguments' does not name a type
static Handle<Value> getFeatureReport(const Arguments& args);
      ^
       ../src/HID.cc:83:48: error: 'Arguments' does not name a type
      static Handle<Value> sendFeatureReport(const Arguments& args);
    ^
       ../src/HID.cc:86:25: error: 'uv_work_t' has not been declared
       static void recvAsync(uv_work_t* req);
      ^
       ../src/HID.cc:87:29: error: 'uv_work_t' has not been declared
       static void recvAsyncDone(uv_work_t* req);
^
 ../src/HID.cc:177:16: error: variable or field 'recvAsync' declared void
  HID::recvAsync(uv_work_t* req)
^
 ../src/HID.cc:177:16: error: 'uv_work_t' was not declared in this scope
  ../src/HID.cc:177:27: error: 'req' was not declared in this scope
    HID::recvAsync(uv_work_t* req)
     ^
      In file included from ../src/HID.cc:30:0:
       /root/.node-gyp/8.1.2/include/node/v8.h: In instantiation of 'static void v8::NonCopyablePersistentTraits<T>::Uncompilable() [with O = v8::Object; T = v8::Object]':
     /root/.node-gyp/8.1.2/include/node/v8.h:613:17:   required from 'static void v8::NonCopyablePersistentTraits<T>::Copy(const v8::Persistent<S, M>&, v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent*) [with S = v8::Object; M = v8::NonCopyablePersistentTraits<v8::Object>; T = v8::Object; v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent = v8::Persistent<v8::Object>]'
       /root/.node-gyp/8.1.2/include/node/v8.h:8724:21:   required from 'void v8::Persistent<T, M>::Copy(const v8::Persistent<S, M>&) [with S = v8::Object; M2 = v8::NonCopyablePersistentTraits<v8::Object>; T = v8::Object; M = v8::NonCopyablePersistentTraits<v8::Object>]'
 /root/.node-gyp/8.1.2/include/node/v8.h:679:14:   required from 'v8::Persistent<T, M>::Persistent(const v8::Persistent<T, M>&) [with T = v8::Object; M = v8::NonCopyablePersistentTraits<v8::Object>]'
 ../src/HID.cc:94:17:   required from here
  /root/.node-gyp/8.1.2/include/node/v8.h:159:37: error: cannot convert 'v8::Primitive*' to 'v8::Object* volatile' in assignment
     *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
^
 /root/.node-gyp/8.1.2/include/node/v8.h:617:5: note: in expansion of macro 'TYPE_CHECK'
     TYPE_CHECK(O, Primitive);
   ^
    /root/.node-gyp/8.1.2/include/node/v8.h: In instantiation of 'static void v8::NonCopyablePersistentTraits<T>::Uncompilable() [with O = v8::Object; T = v8::Function]':
    /root/.node-gyp/8.1.2/include/node/v8.h:613:17:   required from 'static void v8::NonCopyablePersistentTraits<T>::Copy(const v8::Persistent<S, M>&, v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent*) [with S = v8::Function; M = v8::NonCopyablePersistentTraits<v8::Function>; T = v8::Function; v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent = v8::Persistent<v8::Function>]'
      /root/.node-gyp/8.1.2/include/node/v8.h:8724:21:   required from 'void v8::Persistent<T, M>::Copy(const v8::Persistent<S, M>&) [with S = v8::Function; M2 = v8::NonCopyablePersistentTraits<v8::Function>; T = v8::Function; M = v8::NonCopyablePersistentTraits<v8::Function>]'
/root/.node-gyp/8.1.2/include/node/v8.h:679:14:   required from 'v8::Persistent<T, M>::Persistent(const v8::Persistent<T, M>&) [with T = v8::Function; M = v8::NonCopyablePersistentTraits<v8::Function>]'
    ../src/HID.cc:94:17:   required from here
     /root/.node-gyp/8.1.2/include/node/v8.h:159:37: error: cannot convert 'v8::Primitive*' to 'v8::Object* volatile' in assignment
*(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
 ^
    /root/.node-gyp/8.1.2/include/node/v8.h:617:5: note: in expansion of macro 'TYPE_CHECK'
TYPE_CHECK(O, Primitive);
      ^
       ../src/HID.cc: In member function 'virtual v8::Handle<v8::Value> JSException::asV8Exception() const':
      ../src/HID.cc:50:104: warning: control reaches end of non-void function [-Wreturn-type]
virtual Handle<Value> asV8Exception() const { return ThrowException(String::New(message().c_str())); }
      ^
 HID.target.mk:104: recipe for target 'Release/obj.target/HID/src/HID.o' failed
       make: *** [Release/obj.target/HID/src/HID.o] Error 1
   make: Leaving directory '/usr/mtn/app/node_modules/node-hid/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:258:23)
      gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
 gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
     gyp ERR! System Linux 4.9.30-moby
      gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "install"
    gyp ERR! cwd /usr/mtn/app/node_modules/node-hid
   gyp ERR! node -v v8.1.2
  gyp ERR! node-gyp -v v3.6.2
     gyp ERR! not ok
     npm info lifecycle node-hid@0.3.2~install: Failed to exec install script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-hid@0.3.2 install: `sh install.sh`
npm ERR! Exit status 1
      npm ERR!
       npm ERR! Failed at the node-hid@0.3.2 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!     /root/.npm/_logs/2017-06-22T05_55_55_590Z-debug.log
    #

Let me know what you think.

I appreciate any assistance!

TylerLeonhardt commented 7 years ago

FWIW, I also couldn't install this on Mac. Not sure if it's possible either:


> node-hid@0.3.2 preinstall /Users/tylerleonhardt/node_modules/.staging/node-hid-37aeac59
> sh get-hidapi.sh

Cloning into 'hidapi'...
remote: Counting objects: 2006, done.
remote: Total 2006 (delta 0), reused 0 (delta 0), pack-reused 2006
Receiving objects: 100% (2006/2006), 2.72 MiB | 1.76 MiB/s, done.
Resolving deltas: 100% (1174/1174), done.

> node-hid@0.3.2 install /Users/tylerleonhardt/node_modules/node-hid
> sh install.sh

  CC(target) Release/obj.target/hidapi/hidapi/mac/hid.o
../hidapi/mac/hid.c:252:20: warning: comparison of integers of different signs: 'CFIndex' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare]
                if (chars_copied == len)
                    ~~~~~~~~~~~~ ^  ~~~
1 warning generated.
  LIBTOOL-STATIC Release/hidapi.a
  CXX(target) Release/obj.target/HID/src/HID.o
../src/HID.cc:50:79: error: no member named 'New' in 'v8::String'
  virtual Handle<Value> asV8Exception() const { return ThrowException(String::New(message().c_str())); }
                                                                      ~~~~~~~~^
../src/HID.cc:57:12: error: expected class name
  : public ObjectWrap
           ^
../src/HID.cc:61:38: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
  static Handle<Value> devices(const Arguments& args);
                                     ^~~~~~~~~
                                     v8::internal::Arguments
/Users/tylerleonhardt/.node-gyp/7.4.0/include/node/v8.h:148:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/HID.cc:76:34: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
  static Handle<Value> New(const Arguments& args);
                                 ^~~~~~~~~
                                 v8::internal::Arguments
/Users/tylerleonhardt/.node-gyp/7.4.0/include/node/v8.h:148:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/HID.cc:77:35: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
  static Handle<Value> read(const Arguments& args);
                                  ^~~~~~~~~
                                  v8::internal::Arguments
/Users/tylerleonhardt/.node-gyp/7.4.0/include/node/v8.h:148:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/HID.cc:78:36: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
  static Handle<Value> write(const Arguments& args);
                                   ^~~~~~~~~
                                   v8::internal::Arguments
/Users/tylerleonhardt/.node-gyp/7.4.0/include/node/v8.h:148:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/HID.cc:79:36: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
  static Handle<Value> close(const Arguments& args);
                                   ^~~~~~~~~
                                   v8::internal::Arguments
/Users/tylerleonhardt/.node-gyp/7.4.0/include/node/v8.h:148:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/HID.cc:80:45: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
  static Handle<Value> setNonBlocking(const Arguments& args);
                                            ^~~~~~~~~
                                            v8::internal::Arguments
/Users/tylerleonhardt/.node-gyp/7.4.0/include/node/v8.h:148:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/HID.cc:81:47: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
  static Handle<Value> getFeatureReport(const Arguments& args);
                                              ^~~~~~~~~
                                              v8::internal::Arguments
/Users/tylerleonhardt/.node-gyp/7.4.0/include/node/v8.h:148:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/HID.cc:83:48: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
  static Handle<Value> sendFeatureReport(const Arguments& args);
                                               ^~~~~~~~~
                                               v8::internal::Arguments
/Users/tylerleonhardt/.node-gyp/7.4.0/include/node/v8.h:148:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/HID.cc:86:25: error: unknown type name 'uv_work_t'
  static void recvAsync(uv_work_t* req);
                        ^
../src/HID.cc:87:29: error: unknown type name 'uv_work_t'
  static void recvAsyncDone(uv_work_t* req);
                            ^
../src/HID.cc:177:16: error: unknown type name 'uv_work_t'
HID::recvAsync(uv_work_t* req)
               ^
../src/HID.cc:195:40: error: no member named 'New' in 'v8::String'
    argv[0] = Exception::Error(String::New(iocb->_error->message().c_str()));
                               ~~~~~~~~^
../src/HID.cc:200:16: error: no member named 'GetCurrent' in 'v8::Context'
      Context::GetCurrent()->Global()->Get(String::New("Buffer") )
      ~~~~~~~~~^
../src/HID.cc:200:52: error: no member named 'New' in 'v8::String'
      Context::GetCurrent()->Global()->Get(String::New("Buffer") )
                                           ~~~~~~~~^
../src/HID.cc:203:68: error: too few arguments to function call, expected 2, have 1
    Handle<Value> nodeBufferArgs[1] = { Integer::New(message.size()) };
                                        ~~~~~~~~~~~~               ^
/Users/tylerleonhardt/.node-gyp/7.4.0/include/node/v8.h:2541:3: note: 'New' declared here
  static Local<Integer> New(Isolate* isolate, int32_t value);
  ^
../src/HID.cc:215:20: error: unknown type name 'uv_work_t'
HID::recvAsyncDone(uv_work_t* req)
                   ^
../src/HID.cc:217:15: error: calling a protected constructor of class 'v8::HandleScope'
  HandleScope scope;
              ^
/Users/tylerleonhardt/.node-gyp/7.4.0/include/node/v8.h:882:13: note: declared protected here
  V8_INLINE HandleScope() {}
            ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/HID/src/HID.o] Error 1
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 Darwin 16.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "install"
gyp ERR! cwd /Users/tylerleonhardt/node_modules/node-hid
gyp ERR! node -v v7.4.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bluetooth-hci-socket@~0.4.1 (node_modules/noble/node_modules/bluetooth-hci-socket):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for bluetooth-hci-socket@0.4.4: wanted {"os":"linux,win32","arch":"any"} (current: {"os":"darwin","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open '/Users/tylerleonhardt/package.json'
npm WARN tylerleonhardt No description
npm WARN tylerleonhardt No repository field.
npm WARN tylerleonhardt No README data
npm WARN tylerleonhardt No license field.
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "blync"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE

npm ERR! node-hid@0.3.2 install: `sh install.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-hid@0.3.2 install script 'sh install.sh'.
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 node-hid package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     sh install.sh
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-hid
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-hid
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/tylerleonhardt/Desktop/CompSci/Javascript/Node.js/isthemountainout/npm-debug.log