Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ENOENT: no such file or directory #3

Closed
xaviervasques opened this issue Apr 26, 2019 · 13 comments
Closed

Error: ENOENT: no such file or directory #3

xaviervasques opened this issue Apr 26, 2019 · 13 comments

Comments

@xaviervasques
Copy link

Hi,
After following the instruction, I got the following issue:

xaviervmcomsmbp:brain-bits xaviervasques$ npm start

[email protected] start /Users/xaviervasques/Desktop/GitHub/brain-bits
electron .

App threw an error during load
Error: ENOENT: no such file or directory, open '/Users/xavier/Desktop/GitHub/brain-bits/.cache/compiler-info.json.gz'
at Object.openSync (fs.js:453:3)
at Object.func [as openSync] (electron/js2c/asar.js:155:31)
at Object.readFileSync (fs.js:353:35)
at Object.fs.readFileSync (electron/js2c/asar.js:579:40)
at Function.createReadonlyFromConfigurationSync (/Users/xavier/Desktop/GitHub/brain-bits/node_modules/electron-compile/lib/compiler-host.js:497:28)
at Object.init (/Users/xavier/Desktop/GitHub/brain-bits/node_modules/electron-compile/lib/config-parser.js:285:43)
at Object. (/Users/xavier/Desktop/GitHub/brain-bits/index.js:1:29)
at Module._compile (internal/modules/cjs/loader.js:808:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
at Module.load (internal/modules/cjs/loader.js:677:32)

Can someone help me please ?

Thanks

@dashersw
Copy link
Owner

Hello Xavier, could you use npm start to run the app?

@xaviervasques
Copy link
Author

Hello and thank you for your answer. This is what I did and what happened after a npm start

@dashersw
Copy link
Owner

Oh sorry, I didn't see that. Could you try rm -rf ./cache and then npm start again? (It might require another npm install.)

@xaviervasques
Copy link
Author

Thank you. I tried and got the same:

xaviervmcomsmbp:brain-bits xaviervasques$ rm -rf ./cache
xaviervmcomsmbp:brain-bits xaviervasques$ npm start

[email protected] start /Users/xaviervasques/Desktop/GitHub/brain-bits
electron .

App threw an error during load
Error: ENOENT: no such file or directory, open '/Users/xaviervasques/Desktop/GitHub/brain-bits/.cache/compiler-info.json.gz'
at Object.openSync (fs.js:453:3)
at Object.func [as openSync] (electron/js2c/asar.js:155:31)
at Object.readFileSync (fs.js:353:35)
at Object.fs.readFileSync (electron/js2c/asar.js:579:40)
at Function.createReadonlyFromConfigurationSync (/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/electron-compile/lib/compiler-host.js:497:28)
at Object.init (/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/electron-compile/lib/config-parser.js:285:43)
at Object. (/Users/xaviervasques/Desktop/GitHub/brain-bits/index.js:1:29)
at Module._compile (internal/modules/cjs/loader.js:808:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
at Module.load (internal/modules/cjs/loader.js:677:32)

I also tried a new npm install:

xaviervmcomsmbp:brain-bits xaviervasques$ sudo npm install npm -g
/Users/xaviervasques/.nvm/versions/node/v12.0.0/bin/npm -> /Users/xaviervasques/.nvm/versions/node/v12.0.0/lib/node_modules/npm/bin/npm-cli.js
/Users/xaviervasques/.nvm/versions/node/v12.0.0/bin/npx -> /Users/xaviervasques/.nvm/versions/node/v12.0.0/lib/node_modules/npm/bin/npx-cli.js

xaviervmcomsmbp:brain-bits xaviervasques$ node -v
v12.0.0

xaviervmcomsmbp:brain-bits xaviervasques$ npm -v
6.9.0

I tried different ways to install npm

@dashersw
Copy link
Owner

dashersw commented May 2, 2019

I think the problem might be with node.js version! Could you try with a node version of 10 instead of 12?

@xaviervasques
Copy link
Author

Hi Armagan,
Thank you again for your replies. I have tried with node.js version 10 and 8 to see if any difference.

I have now a different error (hope meaning improvement :)

xaviervmcomsmbp:brain-bits xaviervasques$ npm install

[email protected] install /Users/xaviervasques/Desktop/GitHub/brain-bits
node-gyp rebuild

SOLINK_MODULE(target) Release/nothing.node
CXX(target) Release/obj.target/emotiv/lib/bindings.o
In file included from ../lib/bindings.cc:7:
In file included from /Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi.h:1449:
/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:1276:24: error: no matching function for call to 'napi_make_callback'
napi_status status = napi_make_callback(
^~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/8.16.0/include/node/node_api.h:549:25: note: candidate function not viable: requires 7 arguments, but 6 were provided
NAPI_EXTERN napi_status napi_make_callback(napi_env env,
^
In file included from ../lib/bindings.cc:7:
In file included from /Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi.h:1449:
/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:1484:3: error: no matching function for call to 'napi_fatal_error'
napi_fatal_error(location, message);
^~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/8.16.0/include/node/node_api.h:117:33: note: candidate function not viable: requires 4 arguments, but 2 were provided
NAPI_EXTERN NAPI_NO_RETURN void napi_fatal_error(const char* location,
^
In file included from ../lib/bindings.cc:7:
In file included from /Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi.h:1449:
/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:2020:24: error: use of undeclared identifier 'napi_is_construct_call'
napi_status status = napi_is_construct_call(env, info, &isConstructCall);
^
/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:2474:24: error: use of undeclared identifier 'napi_is_construct_call'
napi_status status = napi_is_construct_call(env, info, &isConstructCall);
^
/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:2683:24: error: no matching function for call to 'napi_create_async_work'
napi_status status = napi_create_async_work(
^~~~~~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/8.16.0/include/node/node_api.h:526:13: note: candidate function not viable: requires 7 arguments, but 5 were provided
napi_status napi_create_async_work(napi_env env,
^
../lib/bindings.cc:197:9: error: no matching function for call to 'napi_make_callback'
s = napi_make_callback(env, global, callback, 2, argv, &result);
^~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/8.16.0/include/node/node_api.h:549:25: note: candidate function not viable: requires 7 arguments, but 6 were provided
NAPI_EXTERN napi_status napi_make_callback(napi_env env,
^
../lib/bindings.cc:224:14: error: no matching function for call to 'napi_create_async_work'
status = napi_create_async_work(env, Execute, Complete, &the_carrier, &the_carrier.request);
^~~~~~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/8.16.0/include/node/node_api.h:526:13: note: candidate function not viable: requires 7 arguments, but 5 were provided
napi_status napi_create_async_work(napi_env env,
^
../lib/bindings.cc:256:13: error: no matching function for call to 'napi_make_callback'
s = napi_make_callback(env, global, callback, 0, nullptr, &result);
^~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/8.16.0/include/node/node_api.h:549:25: note: candidate function not viable: requires 7 arguments, but 6 were provided
NAPI_EXTERN napi_status napi_make_callback(napi_env env,
^
../lib/bindings.cc:283:18: error: no matching function for call to 'napi_create_async_work'
status = napi_create_async_work(env, CancelExecute,
^~~~~~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/8.16.0/include/node/node_api.h:526:13: note: candidate function not viable: requires 7 arguments, but 5 were provided
napi_status napi_create_async_work(napi_env env,
^
../lib/bindings.cc:297:14: error: no matching function for call to 'napi_create_async_work'
status = napi_create_async_work(env, CancelExecute,
^~~~~~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/8.16.0/include/node/node_api.h:526:13: note: candidate function not viable: requires 7 arguments, but 5 were provided
napi_status napi_create_async_work(napi_env env,
^
../lib/bindings.cc:334:20: error: cannot initialize a member subobject of type 'napi_addon_register_func' (aka 'napi_value
()(napi_env
_ *, napi_value__ *)')
with an lvalue of type 'void (napi_env, napi_value, napi_value, void *)' (aka 'void (napi_env__ *, napi_value__ *, napi_value__ *, void *)'): different number
of parameters (2 vs 4)
NAPI_MODULE(addon, Init)
^~~~
/Users/xaviervasques/.node-gyp/8.16.0/include/node/node_api.h:105:26: note: expanded from macro 'NAPI_MODULE'
NAPI_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~
/Users/xaviervasques/.node-gyp/8.16.0/include/node/node_api.h:94:7: note: expanded from macro 'NAPI_MODULE_X'
regfunc,
^~~~~~~
11 errors generated.
make: *** [Release/obj.target/emotiv/lib/bindings.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/Cellar/node@8/8.16.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262: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 Darwin 18.5.0
gyp ERR! command "/usr/local/Cellar/node@8/8.16.0/bin/node" "/usr/local/Cellar/node@8/8.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/xaviervasques/Desktop/GitHub/brain-bits
gyp ERR! node -v v8.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! /Users/xaviervasques/.npm/_logs/2019-05-24T17_09_06_998Z-debug.log

@dashersw
Copy link
Owner

Hi Xavier! Is this the output from node version 8? If so, brain-bits only works with version 10 right now. I suspect the error output would be different there, as these napi methods were introduced in version 10.

@xaviervasques
Copy link
Author

Hi Armagan,
It was with version 8 but I run it also with version 10 as you can see here:

xaviervmcomsmbp:brain-bits xaviervasques$ node -v
v10.15.3
xaviervmcomsmbp:brain-bits xaviervasques$ npm -v
6.9.0
xaviervmcomsmbp:brain-bits xaviervasques$ npm install

[email protected] install /Users/xaviervasques/Desktop/GitHub/brain-bits
node-gyp rebuild

SOLINK_MODULE(target) Release/nothing.node
CXX(target) Release/obj.target/emotiv/lib/bindings.o
In file included from ../lib/bindings.cc:7:
In file included from /Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi.h:1449:
/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:1276:24: error: no matching function for call to 'napi_make_callback'
napi_status status = napi_make_callback(
^~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/10.15.3/include/node/node_api.h:567:25: note: candidate function not viable: requires 7 arguments, but 6 were provided
NAPI_EXTERN napi_status napi_make_callback(napi_env env,
^
In file included from ../lib/bindings.cc:7:
In file included from /Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi.h:1449:
/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:1484:3: error: no matching function for call to 'napi_fatal_error'
napi_fatal_error(location, message);
^~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/10.15.3/include/node/node_api.h:135:33: note: candidate function not viable: requires 4 arguments, but 2 were provided
NAPI_EXTERN NAPI_NO_RETURN void napi_fatal_error(const char* location,
^
In file included from ../lib/bindings.cc:7:
In file included from /Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi.h:1449:
/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:2020:24: error: use of undeclared identifier 'napi_is_construct_call'
napi_status status = napi_is_construct_call(env, info, &isConstructCall);
^
/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:2474:24: error: use of undeclared identifier 'napi_is_construct_call'
napi_status status = napi_is_construct_call(env, info, &isConstructCall);
^
/Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:2683:24: error: no matching function for call to 'napi_create_async_work'
napi_status status = napi_create_async_work(
^~~~~~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/10.15.3/include/node/node_api.h:544:13: note: candidate function not viable: requires 7 arguments, but 5 were provided
napi_status napi_create_async_work(napi_env env,
^
../lib/bindings.cc:197:9: error: no matching function for call to 'napi_make_callback'
s = napi_make_callback(env, global, callback, 2, argv, &result);
^~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/10.15.3/include/node/node_api.h:567:25: note: candidate function not viable: requires 7 arguments, but 6 were provided
NAPI_EXTERN napi_status napi_make_callback(napi_env env,
^
../lib/bindings.cc:224:14: error: no matching function for call to 'napi_create_async_work'
status = napi_create_async_work(env, Execute, Complete, &the_carrier, &the_carrier.request);
^~~~~~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/10.15.3/include/node/node_api.h:544:13: note: candidate function not viable: requires 7 arguments, but 5 were provided
napi_status napi_create_async_work(napi_env env,
^
../lib/bindings.cc:256:13: error: no matching function for call to 'napi_make_callback'
s = napi_make_callback(env, global, callback, 0, nullptr, &result);
^~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/10.15.3/include/node/node_api.h:567:25: note: candidate function not viable: requires 7 arguments, but 6 were provided
NAPI_EXTERN napi_status napi_make_callback(napi_env env,
^
../lib/bindings.cc:283:18: error: no matching function for call to 'napi_create_async_work'
status = napi_create_async_work(env, CancelExecute,
^~~~~~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/10.15.3/include/node/node_api.h:544:13: note: candidate function not viable: requires 7 arguments, but 5 were provided
napi_status napi_create_async_work(napi_env env,
^
../lib/bindings.cc:297:14: error: no matching function for call to 'napi_create_async_work'
status = napi_create_async_work(env, CancelExecute,
^~~~~~~~~~~~~~~~~~~~~~
/Users/xaviervasques/.node-gyp/10.15.3/include/node/node_api.h:544:13: note: candidate function not viable: requires 7 arguments, but 5 were provided
napi_status napi_create_async_work(napi_env env,
^
../lib/bindings.cc:334:20: error: cannot initialize a member subobject of type 'napi_addon_register_func' (aka 'napi_value
()(napi_env
_ *, napi_value__ *)') with an lvalue of type
'void (napi_env, napi_value, napi_value, void *)' (aka 'void (napi_env__ *, napi_value__ *, napi_value__ *, void *)'): different number of parameters (2 vs 4)
NAPI_MODULE(addon, Init)
^~~~
/Users/xaviervasques/.node-gyp/10.15.3/include/node/node_api.h:104:26: note: expanded from macro 'NAPI_MODULE'
NAPI_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~
/Users/xaviervasques/.node-gyp/10.15.3/include/node/node_api.h:93:7: note: expanded from macro 'NAPI_MODULE_X'
regfunc,
^~~~~~~
11 errors generated.
make: *** [Release/obj.target/emotiv/lib/bindings.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/Cellar/node@10/10.15.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/Cellar/node@10/10.15.3/bin/node" "/usr/local/Cellar/node@10/10.15.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/xaviervasques/Desktop/GitHub/brain-bits
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! /Users/xaviervasques/.npm/_logs/2019-05-27T09_41_35_095Z-debug.log

If you have any idea :) thank you,
Xavier

@dashersw
Copy link
Owner

Now this is too weird! Is it the same when you try to install https://github.com/dashersw/wits with node v 10?

@xaviervasques
Copy link
Author

Here is the output when I try to install wits with v10 (only warnings)

xaviervmcomsmbp:GitHub xaviervasques$ node -v
v10.15.3
xaviervmcomsmbp:GitHub xaviervasques$ cd wits/
xaviervmcomsmbp:wits xaviervasques$
xaviervmcomsmbp:wits xaviervasques$
xaviervmcomsmbp:wits xaviervasques$
xaviervmcomsmbp:wits xaviervasques$
xaviervmcomsmbp:wits xaviervasques$ npm install

[email protected] preinstall /Users/xaviervasques/Desktop/GitHub/wits
if [ ! -d lib/emokit-c ] ; then git clone https://github.com/dashersw/emokit-c.git lib/emokit-c; fi

[email protected] install /Users/xaviervasques/Desktop/GitHub/wits
node-gyp rebuild

SOLINK_MODULE(target) Release/nothing.node
CC(target) Release/obj.target/emotiv/lib/fprintf_override.o
CXX(target) Release/obj.target/emotiv/lib/bindings.o
CC(target) Release/obj.target/emotiv/lib/emokit-c/src/emokit.o
../lib/emokit-c/src/emokit.c:150:3: warning: implicit declaration of function 'fprintf_override' is invalid in C99 [-Wimplicit-function-declaration]
fprintf_override("libemokit: No Matching Devices, check USB ID\n");
^
../lib/emokit-c/src/emokit.c:158:5: warning: implicit declaration of function 'fprintf_override' is invalid in C99 [-Wimplicit-function-declaration]
fprintf_override("libemokit: Failed to open device #%d, insuffient permissions?\n", count + 1);
^
../lib/emokit-c/src/emokit.c:167:3: warning: implicit declaration of function 'fprintf_override' is invalid in C99 [-Wimplicit-function-declaration]
fprintf_override("libemokit: Insuffient Devices Found For #%d out of %d\n", device_index+1, count);
^
../lib/emokit-c/src/emokit.c:155:12: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
if(count == device_index) {
~~~~~ ^ ~~~~~~~~~~~~
../lib/emokit-c/src/emokit.c:204:6: warning: unused variable 'i' [-Wunused-variable]
int i;
^
../lib/emokit-c/src/emokit.c:256:18: warning: array subscript is of type 'char' [-Wchar-subscripts]
level |= (frame[b] >> o) & 1;
^~
6 warnings generated.
SOLINK_MODULE(target) Release/emotiv.node
added 1 package from 1 contributor, updated 1 package and audited 2 packages in 3.787s
found 0 vulnerabilities

@dashersw
Copy link
Owner

That’s awesome! Are you able to run it as in the readme? Does it print values to the console?

@xaviervasques
Copy link
Author

Hello Armagan,
Finally, it's running. I had got some errors such as:

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/electron/.electron'
or
Error: ENOENT: no such file or directory, open '/Users/xavier/Desktop/GitHub/brain-bits/.cache/compiler-info.json.gz'
or
Users/xaviervasques/Desktop/GitHub/brain-bits/node_modules/node-addon-api/napi-inl.h:1484:3: error: no matching function for call to 'napi_fatal_error'

In the install, I put the following options: --unsafe-perm=true --allow-root and sudo in order to avoid EACCES error

Then it works with node v8.16.0

nvm install 8.16.0
nvm use 8.16.0
and installing node-gyp globally:
npm install -g node-gyp

I had to install manually :
npm install electron -g
and also node-addon-api and fevents

It works now.

Thank you for your help,

@dashersw
Copy link
Owner

That's very interesting! I was just asking to see if wits would work on its own, because it uses the modern node C bindings. I didn't think it would solve brain-bits installation problem.

Because if wits worked, I would suggest to replace the raw EPOC access in brain-bits with wits — I extracted wits out of brain-bits and made it compatible with modern node C bindings. brain-bits is still using the old approach, that's why it doesn't work. If you would be interested in replacing emotiv model inside brain-bits with wits, it would be awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants