wits icon indicating copy to clipboard operation
wits copied to clipboard

Installation of wits fails - Ubuntu 18.04 LTS

Open KudosAbhay opened this issue 6 years ago • 9 comments

I'm trying to install this library using npm install, my machine is Ubuntu 18.04 LTS Run with updated version of Node.js and npm.

I am facing this below mentioned issue:

npm install

`> [email protected] preinstall /home/abhay/Desktop/git/wits

git clone https://github.com/dashersw/emokit-c.git lib/emokit-c`

fatal: destination path 'lib/emokit-c' already exists and is not an empty directory.

npm ERR! Linux 4.15.0-43-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ELIFECYCLE npm ERR! [email protected] preinstall: git clone https://github.com/dashersw/emokit-c.git lib/emokit-c npm ERR! Exit status 128 npm ERR! npm ERR! Failed at the [email protected] preinstall script 'git clone https://github.com/dashersw/emokit-c.git lib/emokit-c'. 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 wits package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! git clone https://github.com/dashersw/emokit-c.git lib/emokit-c npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs wits npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls wits npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/abhay/Desktop/git/wits/npm-debug.log`

KudosAbhay avatar Dec 22 '18 06:12 KudosAbhay

This is a weird issue, are you sure you're installing it from scratch? How about if you try to delete lib/emokit-c library with something like rm -r lib/emokit-c?

dashersw avatar Dec 30 '18 18:12 dashersw

Hi! After I tried rm -r lib/emokit-c now I got the following error:

> [email protected] install /home/a-username/Projects/testing/wits
> node-gyp configure && node-gyp build

make: Entering directory '/home/a-username/Projects/testing/wits/build'
  CXX(target) Release/obj.target/emotiv/lib/bindings.o
In file included from /usr/include/c++/7/ext/string_conversions.h:43:0,
                 from /usr/include/c++/7/bits/basic_string.h:6352,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/functional:54,
                 from /home/a-username/Projects/testing/wits/node_modules/node-addon-api/napi.h:5,
                 from ../lib/bindings.cc:7:
/usr/include/c++/7/cstdio:110:11: error: ‘::fprintf’ has not been declared
   using ::fprintf;
           ^~~~~~~
In file included from ../lib/bindings.cc:9:0:
../lib/emotiv.cc: In function ‘void close()’:
../lib/emotiv.cc:12:5: error: ‘fprintf’ was not declared in this scope
     fprintf(stdout, "closing...\n");
     ^~~~~~~
../lib/emotiv.cc:12:5: note: suggested alternative: ‘dprintf’
     fprintf(stdout, "closing...\n");
     ^~~~~~~
     dprintf
../lib/emotiv.cc: In function ‘void cleanup(int)’:
../lib/emotiv.cc:22:5: error: ‘fprintf’ was not declared in this scope
     fprintf(stdout, "Shutting down\n");
     ^~~~~~~
../lib/emotiv.cc:22:5: note: suggested alternative: ‘dprintf’
     fprintf(stdout, "Shutting down\n");
     ^~~~~~~
     dprintf
../lib/emotiv.cc: In function ‘int connect()’:
../lib/emotiv.cc:36:5: error: ‘fprintf’ was not declared in this scope
     fprintf(stdout, "Current epoc devices connected: %d\n", count);
     ^~~~~~~
../lib/emotiv.cc:36:5: note: suggested alternative: ‘dprintf’
     fprintf(stdout, "Current epoc devices connected: %d\n", count);
     ^~~~~~~
     dprintf
../lib/emotiv.cc: In function ‘emokit_frame get_frame()’:
../lib/emotiv.cc:83:9: error: ‘fprintf’ was not declared in this scope
         fprintf(stderr, "Headset Timeout...\n");
         ^~~~~~~
../lib/emotiv.cc:83:9: note: suggested alternative: ‘dprintf’
         fprintf(stderr, "Headset Timeout...\n");
         ^~~~~~~
         dprintf
../lib/bindings.cc: In function ‘napi_value__* Init(napi_env, napi_value)’:
../lib/bindings.cc:306:5: error: ‘fprintf’ was not declared in this scope
     fprintf(stdout, "set logger", NULL, log);
     ^~~~~~~
../lib/bindings.cc:306:5: note: suggested alternative: ‘dprintf’
     fprintf(stdout, "set logger", NULL, log);
     ^~~~~~~
     dprintf
emotiv.target.mk:106: recipe for target 'Release/obj.target/emotiv/lib/bindings.o' failed
make: *** [Release/obj.target/emotiv/lib/bindings.o] Error 1
make: Leaving directory '/home/a-username/Projects/testing/wits/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-45-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "build"
gyp ERR! cwd /home/a-username/Projects/testing/wits
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

npm ERR! Linux 4.15.0-45-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp configure && node-gyp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp configure && node-gyp build'.
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 wits package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure && node-gyp build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs wits
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls wits
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/a-username/Projects/testing/wits/npm-debug.log

titusfx avatar Mar 10 '19 10:03 titusfx

Oh at least this looks like a simpler problem. I’ll try to have a look if I can redeclare fprintf. I think this is because of gcc differences in Mac and in Linux — it works on Mac.

Could you also maybe try Node v10?

dashersw avatar Mar 10 '19 10:03 dashersw

I will try with Node v10. If I get it run I will try to dockerize it. And make a pull request.

titusfx avatar Mar 10 '19 13:03 titusfx

Same error on Node v10

titusfx avatar Mar 10 '19 16:03 titusfx

OK! I managed to get it running under Ubuntu! I'll post the details soon.

dashersw avatar Mar 10 '19 20:03 dashersw

I have published [email protected] (also on the master branch), can you try installing it? It should be working!

dashersw avatar Mar 11 '19 00:03 dashersw

you can use brain-monitor to see if it works with your Emotiv headset.

dashersw avatar Mar 11 '19 00:03 dashersw

Hi! After installing sudo apt-get install libmcrypt-dev I get it compiled and installed (Both projects ).But I couldn't see run. In any case, I believe that the issue is close. Thanks for the support and fast reply. I will see tomorrow how to make it connect. Happy coding!

titusfx avatar Mar 12 '19 00:03 titusfx