You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It says I am using Node version 12, but I recently installed v13.5.0, so I don't know why it says v12.
Describe the problem or feature request
I am getting this error when I run my electron application: Uncaught Error: Cannot find module 'C:\Users\redacted\Documents\Code\NodeJS\Face-API\node_modules\@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node'. This started happening when I updated my old project that I have linked towards the end, both local dependencies and global. I also updated my node,js to the latest version for what it's worth.
So it seems to be trying to look for NAPI 4, but when I look into /node_modules/@tensorflow/tfjs-node/, there is a folder called build-tmp-napi-v5. Furthermore, and more importantly, when I go into /lib/, I find another folder labeled napi-v5, but nonapi-v4. I was looking at other issues such as #2558 and #2341. From what I gathered, I think I need to downgrade my Node version and perhaps tfjs as well. I haven't tried yet, but I will in an hour or so of this post and post a reply.
npm install log
PS C:\Users\redacted\Documents\Code\NodeJS\Face-API> npm i
node-pre-gyp WARN Using request for node-pre-gyp https download
[canvas] Success: "C:\Users\redacted\Documents\Code\NodeJS\Face-API\node_modules\canvas\build\Release\canvas.node" is installed via remote
npm WARN face-api-testing@2.0.1 No repository field.
added 366 packages from 291 contributors and audited 792 packages in 27.51s
5 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
Electron's logging output
[14832:0103/202922.885:INFO:CONSOLE(38)] "Platform browser has already been set. Overwriting the platform with [object Object].", source: C:\Users\redacted\Documents\Code\NodeJS\Face-API\node_modules@tensorflow\tfjs-core\dist\environment.js (38)
[14832:0103/202923.119:VERBOSE1:CONSOLE(8157)] "Main._createAppUI: 27.920166015625ms", source: devtools://devtools/bundled/shell.js (8157)
[14832:0103/202923.166:VERBOSE1:CONSOLE(8157)] "Main._showAppUI: 17.798828125ms", source: devtools://devtools/bundled/shell.js (8157)
[14832:0103/202923.178:VERBOSE1:CONSOLE(8157)] "Main._initializeTarget: 11.094970703125ms", source: devtools://devtools/bundled/shell.js (8157)
[14832:0103/202923.315:VERBOSE1:CONSOLE(8157)] "Main._lateInitialization: 1.885009765625ms", source: devtools://devtools/bundled/shell.js (8157)
[14832:0103/202923.324:WARNING:CONSOLE(2419)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
Policy set or a policy with "unsafe-eval" enabled. This exposes users of
this app to unnecessary security risks.
For more information and help, consult https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: electron/js2c/sandbox_bundle.js (2419)
node-pre-gyp info This Node instance does not support builds for N-API version 5
node-pre-gyp info This Node instance does not support builds for N-API version 5
[14832:0103/202923.405:INFO:CONSOLE(720)] "Uncaught Error: Cannot find module 'C:\Users\redacted\Documents\Code\NodeJS\Face-API\node_modules@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node'
Require stack:
C:\Users\redacted\Documents\Code\NodeJS\Face-API\index.html", source: internal/modules/cjs/loader.js (720)
[14832:0103/202923.503:INFO:CONSOLE(2854)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
Policy set or a policy with "unsafe-eval" enabled. This exposes users of
this app to unnecessary security risks.
For more information and help, consult https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: electron/js2c/renderer_init.js (2854)
C:\Users\redacted\Documents\Code\NodeJS\Face-API\index.html
at Module._resolveFilename (internal/modules/cjs/loader.js:717:15)
at Function../lib/common/reset-search-paths.ts.Module._resolveFilename (electron/js2c/renderer_init.js:925:16)
at Module._load (internal/modules/cjs/loader.js:622:27)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at Module.require (internal/modules/cjs/loader.js:775:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object. (C:\Users\redacted\Documents\Code\NodeJS\Face-API\node_modules@tensorflow\tfjs-node\dist\index.js:46:16)
at Object. (C:\Users\redacted\Documents\Code\NodeJS\Face-API\node_modules@tensorflow\tfjs-node\dist\index.js:68:3)
at Module._compile (internal/modules/cjs/loader.js:880:30)
Code to reproduce the bug / link to feature request
I got around to coming back to this issue in an attempt to further troubleshoot it. I took a look once more at #2341 and realized that I also was using a different node.js version that Electron was (compiled with?). As of Jan 4th 2020, the latest Electron version is 7.1.7 and it is using Node version 12.8.1, so I installed Node v12.8.1 and tried everything once more. Voila! Problem solved.
If anyone else is having this issue, make sure your installed node.js version is the same as the version of Electron you're using!
EDIT: Although I'm curious, could this error be mitigated either by tfjs OR electron?
I am fairly new to node.js and Electron let alone tensorflow for js, so pardon my ignorance.
TensorFlow.js version
"@tensorflow/tfjs-node": "^1.5.1"
Browser version
I am using Electron and this is what is returned using
process.versions
It says I am using Node version 12, but I recently installed v13.5.0, so I don't know why it says v12.
Describe the problem or feature request
I am getting this error when I run my electron application:
Uncaught Error: Cannot find module 'C:\Users\redacted\Documents\Code\NodeJS\Face-API\node_modules\@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node'
. This started happening when I updated my old project that I have linked towards the end, both local dependencies and global. I also updated my node,js to the latest version for what it's worth.So it seems to be trying to look for NAPI 4, but when I look into
/node_modules/@tensorflow/tfjs-node/
, there is a folder calledbuild-tmp-napi-v5
. Furthermore, and more importantly, when I go into/lib/
, I find another folder labelednapi-v5
, but nonapi-v4
. I was looking at other issues such as #2558 and #2341. From what I gathered, I think I need to downgrade my Node version and perhaps tfjs as well. I haven't tried yet, but I will in an hour or so of this post and post a reply.npm install log
Electron's logging output
Chrome Console's Output When Running The App
Code to reproduce the bug / link to feature request
https://github.com/Infinitay/face-rec-photo-gallery/tree/testing-v2.0.2
The text was updated successfully, but these errors were encountered: