-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
How to resolve Error: dlopen("") : Library not loaded Referenced () in nodejs #2109
Comments
Check |
@bnoordhuis Thank you for replying . i have tried to add -flat_namespace
but didn't worked for me .
I think there should be name of lib.so file but not sure about the same . |
@bnoordhuis i made some changes i tried to used .dylib instead of .so file .
now when i am running otool -L filename.dylib command . i get following output :
Error i am getting while calling modules from project
|
I think you're almost there. Try |
Jumping into this issue without intent to hijack it: Based on the above, I added this into node-oracledb's existing binding.gyp
and that seems (in limited testing) seems to have solved the same problem for node-oracledb. Our install instructions suggest putting the (unchangeable) Oracle Client libraries in ~/lib so maybe this change will be acceptable. |
@bnoordhuis and @cjbj Thank you for replying ,so issue was when i was requiring module .js file into the project root .module file working directory changes from module folder to project root directory due to this module was not able to find .dylib . so i just added process.chdir(__dirname) and it worked for me. but there is any way i can link path with lib.dylib as it is already done with /use/lib/libc++.1.dylib .
|
@shivam201312 I'll close this because it sounds like you've found a working solution? If not, let me know. |
Hi.. i am trying to build node module using NAPI . i am using node-gyp for creating .node file
on MacOS i ran into issue
Error:
When i am running example in node_module directory then it is not throwing any error .code is running fine inside node_module.
ProjectDir/node_module/modulename/example.js -> code is running
ProjectDir/example.js -> it is showing me above error .
Structure of my module
moduefile.cc
lib.so
lib.h
binding.gyp file
binding.gyp for MacOS
So , i tried to resolve above issue made some changes in binding.gyp
It resolves above issue but throws new error while calling function of module.now i am getting error in both inside node_moduel and project root
ProjectDir/node_module/modulename/example.js -> Throwing Error
ProjectDir/example.js -> Throwing Error
Error
From above error it seems modulefile.cc file is not able to call functions from lib.so file after i made some changes in binding.gyp.
it is strange that earlier javascript was running fine inside node_module folder but throwing error while trying to running same javascript in project root directory
Question :
The text was updated successfully, but these errors were encountered: