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

librcl.so: cannot open shared object file: No such file or directory #943

Open
Mithilesh982 opened this issue Nov 24, 2023 · 3 comments
Open
Labels

Comments

@Mithilesh982
Copy link

Description
I'm built a web app using React as frontend and node.js as backend , to connect ros2 and my nodejs im using rclnodejs but while running the code error is showing like :
server/node_modules/bindings/bindings.js:121
throw e;
^
Error: librcl.so: cannot open shared object file: No such file or directory
at Module._extensions..node (node:internal/modules/cjs/loader:1473:18)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at bindings (/home/eric/CUB-E_frontent_r2/server/node_modules/bindings/bindings.js:112:48)
at Object. (/home/eric/CUB-E_frontent_r2/server/node_modules/rclnodejs/lib/clock.js:17:38)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32) {
code: 'ERR_DLOPEN_FAILED'
}
-node : v20.10.0

  • Library Version: rclnodejs 0.23.2
  • ROS Version: Ros2 humble
  • Platform / OS: ubuntu 22.04

Steps To Reproduce

const rclnodejs = require('rclnodejs')
rclnodejs.init().then(()=>{
const node = new rclnodejs.Node('ros2_connectivity_turtlebot3');
const publisher = rclnodejs.createPublisher('std_msgs/msg/String','cmd_vel ')
publisher.publish('Hello from react server')

node.spin()

})

Expected Behavior
srever running on 4000

Actual Behavior
error

@minggangw
Copy link
Member

It seem that the ld doesn't find the librcl.so, please check echo $LD_LIBRARY_PATH to see if the ROS2 lib path is there?

@Mithilesh982
Copy link
Author

It seem that the ld doesn't find the librcl.so, please check echo $LD_LIBRARY_PATH to see if the ROS2 lib path is there?

Ros2 lib is path Setup correctly, Thanks for your time .
The error occurred because of nodejs version 20.x , rclnodejs version is only compatible with nodejs version 10.23.1 - 19.x. , so I just reinstall 19.x version and it solved the error.

You can see the full installation of rclnodejs from scratch https://github.com/ros2/ros2/blob/master/ros2.repos.

@minggangw
Copy link
Member

I'm using nodejs v20.9.0, but didn't meet this error. Not sure why it doesn't work on your env.

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

No branches or pull requests

2 participants