rclnodeJs installation broken: "Could not locate the bindings file"
See original GitHub issueDescription We’ve been transitioning an electron app that uses roslibjs over to a ros2 interface. But, currently pulling our hair out trying to get things playing nicely.
Here’s an MVP application (https://github.com/nckswt/ros2-electron-app-mvp) to recreate the issue. The main issue we’re facing is this error:
Uncaught Error: Could not locate the bindings file. Tried:
→ /home/nick/ros2-electron-app-mvp/build/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/build/Debug/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/build/Release/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/out/Debug/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/Debug/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/out/Release/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/Release/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/build/default/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/compiled/14.16.0/linux/x64/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/addon-build/release/install-root/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/addon-build/debug/install-root/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/addon-build/default/install-root/rclnodejs.node
→ /home/nick/ros2-electron-app-mvp/lib/binding/node-v87-linux-x64/rclnodejs.node
at bindings (bindings.js:126)
at Object../node_modules/rclnodejs/lib/clock.js (clock.js:17)
at __webpack_require__ (bootstrap:24)
at fn (hot module replacement:61)
at Object../node_modules/rclnodejs/index.js (index.js:17)
at __webpack_require__ (bootstrap:24)
at fn (hot module replacement:61)
at Object../src/index.js (index.js:11)
at __webpack_require__ (bootstrap:24)
at startup:6
This PR makes me think we should be able to load rclnodejs
into the electron renderer.
- Library Version:
0.20.1
- ROS Version:
galactic
- Platform / OS:
Ubuntu 20.04.3 LTS
- Node version:
v12.22.7
Steps To Reproduce
git clone git@github.com:nckswt/ros2-electron-app-mvp.git
npm i
npm run start:dev
Expected Behavior
I’d expect the node to run without crashing.
Actual Behavior See error above.
Wondering if there’s something I need to do to generate the bindings file? Or if there’s an incompatibility with my NodeJS setup somehow? Or if it’s even an upstream issue?
Please let me know if there’s more info I can provide for debugging.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11
Top Results From Across the Web
Error: Could not locate the bindings file · Issue #1511 - GitHub
Facing the below issue while running the node in VSC: Node Version: node -v6.14.2 and npm -v3.10.10. Platform: Windows(64 bit). Error: Could ......
Read more >Error: Could not locate the bindings file. Tried: #56
I spoke to the developer, and he said that it was a bug in node-gyp, you should simply do the following: npm install...
Read more >Error: Could not locate the bindings file - Edge Impulse Forum
I just tried installing node.js 16.4.0 using nvm as you suggested above. entering node --version confirms that v16.4.0 is running. Unfortunately ...
Read more >Error: Could not locate the bindings file. Tried - Countly
I installed countly with; wget... ... Error: Could not locate the bindings file. Tried: → ... steps, but it does not working main...
Read more >Introducing The rclnodejs-cli Tools for ROS 2 JavaScript Coders
Alternatively you can install rclnodejs-cli as a global package and run it directly ... You can find all of the generated serialization files...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I apologize but I was not able to spend the time to debug an
ENOENT
for../app.asar/build/preload.js
error. This error is related to thewebpack.prd.config.js
,package.json
, and the location ofpreload.js
.While I wanted to quickly solve the
npm run start:dist
, instead I’ve provided some high-level comments which provide context on whether apreload.js
script should be used at all, among other items which I hope you find helpful.Comments
extraResources
can be helpful for keeping some production files writeable (e.g., a database), but as you have identified, it is not appropriate to include unbundlednode_modules/
. I personally have not encountered an issue includingrclnodejs
in the AppImage as well as in development - did you trace the error directly torclnodejs
being missing or was it thepreload.js
error that I alluded to above (which would makerclnodejs
undefined
in production) that stopped you? Also see this issue.build/
is not generated but rather for assets to be included in the build (such as logos, etc.)public/
is solely for the static files through which the rest of the application is mounted (i.e., usually just anindex.html
file andfavicon.icon
)src/
. While the structure is up to you, often people usesrc/main
for the main process file (i.e.,main.js
) andsrc/renderer
for the renderer process - i.e., your React app source code. The big idea is simply that source code doesn’t live inpublic/
.rclnodejs
in the view (e.g., React app) renderer process is not necessary to distribute it with Electron. You can have multiple “renderer” (or more aptly, “worker”) Electron proccesses which run in Node and communicate with the view overWebSocket
connection,ipcRenderer
, or other communication bridge. Our team found this encapsulation ofrclnodejs
to be simpler to work with, since it decouplesrclnodejs
and ROS from your view layer. See electron-ros below for more details.preload.js
isn’t a best practice withnodeIntegration
enabled, since the purpose of a preload script is to use Node modules in the browser withnodeIntegration
disabled. Was just a quick fix to run the project as-is.Resources
As I probably won’t be able to provide too much of a further look, hopefully these are helpful:
rclnodejs
in Electron which covers manyrclnodejs
specific issues.Lastly @wayneparrott if @nckswt is okay with it, I might suggest closing this issue or at least removing the bug label, as the original bindings file issue is more of a limitation of
rclnodejs
integration with Webpack than a bug withrclnodejs
itself. Once again sorry I couldn’t immediately fix thenpm run start:dist
issue.I was hoping someone with more electron experience than me would pick up this issue. I’ll give it a go tomorrow and see what I learn. @nckswt Thx for the mvp. Please share any new info you may have on the matter.