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

Problem with converting web bridge into a binary with nexe #155

Open
apoorvcn47 opened this issue Sep 30, 2020 · 4 comments
Open

Problem with converting web bridge into a binary with nexe #155

apoorvcn47 opened this issue Sep 30, 2020 · 4 comments

Comments

@apoorvcn47
Copy link

apoorvcn47 commented Sep 30, 2020

When I try to convert rosbridge.js into a binary with nexe and put it in another directory, it cannot find binding and rclnodejs modules. While compiling, i do provide linking with node_modules, lib, package.json and index.js. Is there anything I am doing wrong? Following is the command I am using for compilation

nexe rosbridge.js -r "../lib/.js" -r "../node_modules/" -r "../index.js" -r "../package.json"

@minggangw
Copy link
Member

Please rclnodejs.node is included.

@apoorvcn47
Copy link
Author

Unfortunately that did not work. Following is the error I am getting

/home/aw_rdex/Desktop/node_modules/bindings/bindings.js:211
throw new Error(
^

Error: Could not find module root given file: "/home/aw_rdex/Desktop/node_modules/rclnodejs/lib/clock.js". Do you have a package.json file?
at Function.getRoot (/home/aw_rdex/Desktop/node_modules/bindings/bindings.js:211:13)
at bindings (/home/aw_rdex/Desktop/node_modules/bindings/bindings.js:82:32)
at Object. (/home/aw_rdex/Desktop/node_modules/rclnodejs/lib/clock.js:17:38)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)

I am including clock.js specifically. Following is my compilation command

nexe rosbridge2.js -r "./lib/.js" -r "./node_modules/" -r "./index.js" -r "./package.json" -r "./node_modules/rclnodejs/build/Release/obj.target/rclnodejs.node" -r "./node_modules/bindings/.js" -r "./node_modules/rclnodejs/lib/*.js" -r "./node_modules/rclnodejs/index.js" -r "./node_modules/rclnodejs/package.json" -r "./node_modules/rclnodejs/lib/clock.js"

@minggangw
Copy link
Member

The log shows the rclnodejs.node is not found, please check the source code of clock.js

const rclnodejs = require('bindings')('rclnodejs');

@apoorvcn47
Copy link
Author

apoorvcn47 commented Oct 5, 2020

yes i understand that but based on my compilation command, it should be included, correct?

Sorry if I am being difficult, dont have much experience with javascript

Is compilation working for you?

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