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

Node custom plugin issue return process.dlopen(module, path.toNamespacedPath(filename)); #3675

Open
CaptianFluffy100 opened this issue Jan 3, 2022 · 5 comments
Labels

Comments

@CaptianFluffy100
Copy link

Details

Hello, I recently started to code C++ plugins for nodejs. I have two pcs with node version 16.13.0, npm v8.1.0. On the PC that I built the plugin, runs the plugin fine, but as soon as I copy the plugin onto the other PC and import(require) it into node the same way as I did with the PC, it throws an error.

node:internal/modules/cjs/loader:1183 return process.dlopen(module, path.toNamespacedPath(filename));

Error: /home/"user"/"project folder"/"plugin folder"/"plugin name".node: cannot open shared object file: No such file or directory at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/home/henk/DroneSoftware/app.js:272:20) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) { code: 'ERR_DLOPEN_FAILED' }

This file does exist.

Node.js version

16.13.0

Example code

No response

Operating system

Ubuntu 20.04 LTS & Ubuntu 18.04 LTS

Scope

Not applicable.

Module and version

Not applicable.

@tniessen
Copy link
Member

tniessen commented Jan 4, 2022

The quotation marks in the path in the error message surprise me. What path are you passing to require?

@gireeshpunathil
Copy link
Member

ping @CaptianFluffy100

@RSS1102
Copy link

RSS1102 commented Dec 22, 2023

A terrible problem, I don't know how it came about either,i aslo get this error.I was searching for an answer to this and came here.


I tried to copy a *. node file and access it using JavaScript , ( which was generated by node-canvas ).
As he said, I can't access it when I want to package and copy it into my other package.


Because node-canvas has stopped maintenance, I don't know if it's the node's problem or node-canvasproblem, but I saw that node/api/cli.md?plain=1#L129mentioned the same code.
image

@RSS1102
Copy link

RSS1102 commented Dec 25, 2023

nodejs

It seems that the way of accessing binary files is incorrect. If it is accessed directly according to the path, it will get this error

Copy link

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.

@github-actions github-actions bot added the stale label Jun 23, 2024
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

4 participants