charliegerard / Epoc.js

Node.js addon for the Emotiv C++ SDK
MIT License
782 stars 48 forks source link

error with npm install epocjs #2

Open ecargnfx opened 7 years ago

ecargnfx commented 7 years ago

Any fix for this?

npm ERR! Failed at the epocjs@1.0.6 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the epocjs package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild

piotrekkmt commented 7 years ago

I can relate to this. On a Mac the package assumes you already set up your .frameworks and also looks for the Unity4Xc library in the Xcode library.

~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin' not present in DVTPlugInCompatibilityUUIDs

Could these be included with the bundle so that the necessary files would be included in the node_modules?

Peters-MacBook-Air:pi2d2 peterpoliwoda$ npm install --save epocjs

> epocjs@1.0.6 install /Users/peterpoliwoda/Git/pi2d2/node_modules/epocjs
> node-gyp rebuild

2017-05-23 20:12:21.486 xcodebuild[26742:4325592] [MT] PluginLoading: Required plug-in compatibility UUID DFFB3951-EB0A-4C09-9DAC-5F2D28CC839C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2017-05-23 20:12:21.491 xcodebuild[26742:4325592] Failed to load plugin at: /Users/peterpoliwoda/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin, skipping.  Reason for failure: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]
  CXX(target) Release/obj.target/index/epoc.o
2017-05-23 20:12:23.523 xcodebuild[26761:4325666] [MT] PluginLoading: Required plug-in compatibility UUID DFFB3951-EB0A-4C09-9DAC-5F2D28CC839C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2017-05-23 20:12:23.524 xcodebuild[26761:4325666] Failed to load plugin at: /Users/peterpoliwoda/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin, skipping.  Reason for failure: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]
  CXX(target) Release/obj.target/index/Functions.o
In file included from ../Functions.cc:2:
../epocutils.hpp:16:10: fatal error: 'edk.h' file not found
#include "edk.h"
         ^
1 error generated.
make: *** [Release/obj.target/index/Functions.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:204:12)
gyp ERR! System Darwin 16.5.0
gyp ERR! command "/usr/local/Cellar/node/6.1.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/peterpoliwoda/Git/pi2d2/node_modules/epocjs
gyp ERR! node -v v6.1.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/Cellar/node/6.1.0/bin/node" "/usr/local/bin/npm" "install" "--save" "epocjs"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE

npm ERR! epocjs@1.0.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the epocjs@1.0.6 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 epocjs 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 epocjs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls epocjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/peterpoliwoda/Git/pi2d2/npm-debug.log
charliegerard commented 7 years ago

Hey! I just pushed a major update to the code and the SDK files are now included. Would you mind trying again and letting me know if it works? Works for me with Node v6 but not v7

peterpoliwoda commented 7 years ago

Hiya, my Unity problem was semi-related to this, it was actually Unity's own fault which went away after an upgrade and removing of a shortcut link that pointed nowhere. On the other hand, still having trouble installing the module:

My current Node version:

 ~/Development/git/epocjs    node -v
v6.9.4

Clang is looking for missing files in: '/usr/local/lib/ (...)'. See logs below:

~/Development/git/epocjs    npm install epocjs

> epocjs@2.0.1 install /Users/peterpoliwoda/Development/git/epocjs/node_modules/epocjs
> node-gyp rebuild

  CXX(target) Release/obj.target/index/epoc.o
../epoc.cc:33:8: warning: unused variable 'onStateChanged' [-Wunused-variable]
  bool onStateChanged = false;
       ^
../epoc.cc:38:7: warning: unused variable 'batteryLevel' [-Wunused-variable]
  int batteryLevel = 0;
      ^
../epoc.cc:39:7: warning: unused variable 'maxBatteryLevel' [-Wunused-variable]
  int maxBatteryLevel = 0;
      ^
../epoc.cc:41:23: warning: unused variable 'wirelessStrength'
      [-Wunused-variable]
  EE_SignalStrength_t wirelessStrength;
                      ^
4 warnings generated.
  **SOLINK_MODULE(target) Release/index.node
clang: error: no such file or directory: '/usr/local/lib/libedk.dylib'
clang: error: no such file or directory: '/usr/local/lib/libedk.1.dylib'
clang: error: no such file or directory: '/usr/local/lib/libedk.1.0.0.dylib'
clang: error: no such file or directory: '/usr/local/lib/libedk_ultils_mac.dylib'
clang: error: no such file or directory: '/usr/local/lib/libiomp5.dylib'
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X** 10.9 [-Wdeprecated]
make: *** [Release/index.node] 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.5.0
gyp ERR! command "/usr/local/Cellar/node@6/6.9.4/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/peterpoliwoda/Development/git/epocjs/node_modules/epocjs
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/Users/peterpoliwoda/Development/git/epocjs/package.json'
npm WARN epocjs No description
npm WARN epocjs No repository field.
npm WARN epocjs No README data
npm WARN epocjs No license field.
npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/Cellar/node@6/6.9.4/bin/node" "/usr/local/bin/npm" "install" "epocjs"
npm ERR! node v6.9.4
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! epocjs@2.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the epocjs@2.0.1 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 epocjs 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 epocjs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls epocjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/peterpoliwoda/.npm/_logs/2017-06-03T18_21_51_872Z-debug.log
charliegerard commented 7 years ago

Ok, sorry, the paths to the libraries were wrong. I updated them. If you already installed the EmotivXavier SDK on your computer, you should now have the libraries under /usr/local/lib/EmotivXavier-PREMIUM/. You should be able to update the module and try again.

Also, I'm using Node v6.10.2.

Let me know if this helps!

peterpoliwoda commented 7 years ago

OK, getting warmer, I looked through my filesystem and found no sign of any libedk. files lurking in the /Libraries or /usr/ 's. The other thing is, you are using the Premium SDK and all I have is the measly community version :)

ecargnfx commented 7 years ago

Thanks Charlie for the update! Will see if I get it working this time

charliegerard commented 7 years ago

@peterpoliwoda @ecargnfx I did some research and realised that the files "libedk.*" were part of the old SDK. The new SDK should be available under "/Library/Frameworks/edk.framework/", but it uses new functions like "IEE_EmoEngineEventCreate()" instead of "EE_EmoEngineEventCreate()" so I need to refactor the code to use the new functions.

It shouldn't take too long if you give me a few days to get back to you! :)

peterpoliwoda commented 7 years ago

That's great. Thanks a ton Charlie!

charliegerard commented 7 years ago

@peterpoliwoda Sorry for the delay, I've finally found time to make some updates! :) I've updated the version to 2.1.0 so, would you mind updating and trying again please?

If you haven't installed the Emotiv SDK yet, you can download it here and copy the edk.framework folder to /Library/Frameworks/ (on Mac).

Let me know if you run into any issue!

ecargnfx commented 7 years ago

Thank you Charlie!! Trying it out. Will be so awesome to get this working

On Sat, Jun 24, 2017 at 6:23 AM, Charlie notifications@github.com wrote:

@peterpoliwoda https://github.com/peterpoliwoda Sorry for the delay, I've finally found time to make some updates! :) I've updated the version to 2.1.0 so, would you mind updating and trying again please?

If you haven't installed the Emotiv SDK yet, you can download it here https://github.com/Emotiv/community-sdk/tree/master/lib and copy the edk.framework folder to /Library/Frameworks/ (on Mac).

Let me know if you run into any issue!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/charliegerard/Epoc.js/issues/2#issuecomment-310786013, or mute the thread https://github.com/notifications/unsubscribe-auth/AAlPZ4VidQ90MpbSGNOe95BTXJMUHpKpks5sHDrogaJpZM4LAWof .

piotrekkmt commented 6 years ago

Hey Charlie, tested it on node v6.11.5. It's installing alright, with some warnings now:

~/Git/devfest17hackathon ⑂master*  npm install --save epocjs

> epocjs@2.1.2 install /Users/peterpoliwoda/Git/devfest17hackathon/node_modules/epocjs
> node-gyp rebuild

  CXX(target) Release/obj.target/index/epoc.o
../epoc.cc:47:8: warning: unused variable 'onStateChanged' [-Wunused-variable]
  bool onStateChanged = false;
       ^
../epoc.cc:51:7: warning: unused variable 'batteryLevel' [-Wunused-variable]
  int batteryLevel = 0;
      ^
../epoc.cc:52:7: warning: unused variable 'maxBatteryLevel' [-Wunused-variable]
  int maxBatteryLevel = 0;
      ^
../epoc.cc:54:24: warning: unused variable 'wirelessStrength' [-Wunused-variable]
  IEE_SignalStrength_t wirelessStrength;
                       ^
4 warnings generated.
  SOLINK_MODULE(target) Release/index.node
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
+ epocjs@2.1.2
added 3 packages in 21.823s

running into trouble with running the sample script is giving out that there's some missing files. (sorry it took that long btw)

~/Git/devfest17hackathon ⑂master*  node emotiv.js 
/Users/peterpoliwoda/Git/devfest17hackathon/node_modules/bindings/bindings.js:83
        throw e
        ^

Error: dlopen(/Users/peterpoliwoda/Git/devfest17hackathon/node_modules/epocjs/build/Release/index.node, 1): Library not loaded: libedk.1.dylib
  Referenced from: /Users/peterpoliwoda/Git/devfest17hackathon/node_modules/epocjs/build/Release/index.node
  Reason: image not found
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at bindings (/Users/peterpoliwoda/Git/devfest17hackathon/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/Users/peterpoliwoda/Git/devfest17hackathon/node_modules/epocjs/index.js:3:31)
    at Module._compile (module.js:570:32)
charliegerard commented 6 years ago

Hey!

Don't worry about the warnings, it's just some unused variables that I need to clean up.

About the error though, I made some changes last week when I was updating some parts of the code (I added some code to access the gyroscope data!! :D), have you updated the module to the latest version?

piotrekkmt commented 6 years ago

I got the latest epocjs node module and got the fresh .framework file for the Mac, one from the Emotiv community github. I poked around the module a bit to try to give the libedk an absolute file path, which didn’t help much. I’m not too familiar with C++ (?). Maybe it’s not set up as a dependency?

charliegerard commented 6 years ago

Ok, I can try and install the module on my new laptop and I'll see if i run into the same issues and will let you know when i get time to fix it! :)

charliegerard commented 6 years ago

Hey @piotrekkmt !

I made some changes today and updated the version of the module, do you mind trying again and letting me know if you still have some issues?

piotrekkmt commented 6 years ago

Sure thing, I'll try it tonight after work. Thanks for a quick response. Btw, I heard you're coming to Ireland. The conference place looks amazing 😄 !

charliegerard commented 6 years ago

Alright, I think I (finally) fixed it! I've had to add some dynamic libraries inside the lib folder so you shouldn't get any error about missing files anymore. Usually these dynamic libraries should be added to your /usr/local/lib/ folder (on Mac), but just to make it easier, i just added them in the project and referenced the right path in the binding.gyp file.

Also, I've realised it works better with the v3.4.0 of the community SDK, not the latest one (3.5.0). So if you could re-download the SDK if you don't have the correct version, that would be good!

Let me know when you get time to try that out and fingers crossed this time it will work just fine! 🤞

And, yes, I'll be in Ireland next week!! 😃

piotrekkmt commented 6 years ago

Yep, can confirm it installs and runs now. Now I need to figure out how to retrieve the profiles but that's a story for another coffee infused evening. Thank you for fixing it!

Enjoy Kilkenny, it's a nice spot! Shame I can't attend NodeConf. Maybe you could give a talk on some Jedi powers in one of the Dublin meetups too, if you're around for a bit longer 😄?

ecargnfx commented 6 years ago

Thanks for the update! Will try this out as well. In the meantime, I had created my projects using the Muse node package.