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

npm run test , error #2

Open
qkren opened this issue May 8, 2021 · 3 comments
Open

npm run test , error #2

qkren opened this issue May 8, 2021 · 3 comments

Comments

@qkren
Copy link

qkren commented May 8, 2021

This is me again

when i run the command npm run test , the demo is Run failed on windows

for ([header, headerLoader] of Object.entries(library.headers)) {
console.log(headerLoader)
headers[header] = await headerLoader(); // This step reports an error
}
Some people say extern "C", when it's exported
UnhandledPromiseRejectionWarning: Error: Dynamic Symbol Retrieval Error: Win32 error 127
at DynamicLibrary.get (D:\test\node-ffi-library-libusb-v1.0.23-develop\node_modules\ffi-napi\lib\dynamic_library.js:113:11)
at D:\test\node-ffi-library-libusb-v1.0.23-develop\node_modules\ffi-napi\lib\library.js:55:21
at Array.forEach ()
at new Library (D:\test\node-ffi-library-libusb-v1.0.23-develop\node_modules\ffi-napi\lib\library.js:52:28)
at Object. (D:\test\node-ffi-library-libusb-v1.0.23-develop\platforms\windows-x86_64\include\libusb-1.0\libusb.h.js:116:21)
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)
(node:21540) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:21540) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@qkren
Copy link
Author

qkren commented May 8, 2021

it worked on macOS but not windows, alas~~

@joelpurra
Copy link
Member

joelpurra commented May 8, 2021

@qkren: I know you said you are running windows-x86_64, but are you perhaps mixing it with 32 bit versions of some software, like the compiler? I see C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe in your file paths in #1 (comment).

"Win32 error 127" is ERROR_PROC_NOT_FOUND, which seems to hint at 32/64 bit problems.

(I assume that there is no path problems, and that the .dll file is found on disk.)

@joelpurra
Copy link
Member

@qkren: just updated this library to v2.0.0, with upgrade ffi-napi/ref-napi dependencies etcetera. Does it work better?

Btw, all code is fully generated by https://github.com/node-ffi-packager/node-ffi-packager v2.0.0 (that is where the version number comes from).

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

No branches or pull requests

2 participants