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

dll注册失败 #11

Open
terryvince opened this issue Sep 20, 2022 · 4 comments
Open

dll注册失败 #11

terryvince opened this issue Sep 20, 2022 · 4 comments

Comments

@terryvince
Copy link

只要导入了该包,就会包dll注册失败,

child_process.js:866
throw err;
^

Error: Command failed: regsvr32 E:\vvan\project\free area\autoLock\node_modules\dm.dll\dist\dm.dll /s
at checkExecSyncError (child_process.js:790:11)
at Object.execSync (child_process.js:863:15)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18) {
status: 3,
signal: null,
output: [ null, Buffer(0) [Uint8Array] [], Buffer(0) [Uint8Array] [] ],
pid: 21632,
stdout: Buffer(0) [Uint8Array] [],
stderr: Buffer(0) [Uint8Array] []
}

尝试过,将dll放入system32合64对应位置,手动执行regsvr32注册成功后,再运行,还是报同样的错

@aweiu
Copy link
Owner

aweiu commented Sep 20, 2022

要用管理员模式执行你的 node 程序

@terryvince
Copy link
Author

我打开命令提示符,管理员模式执行也是报同样的错,但是如果我手动再命令提示符执行regsvr32 E:\vvan\project\free area\autoLock\node_modules\dm.dll\dist\dm.dll /s 这句命令,就没有错误提示。只要用node执行child_process.exec注册dll就会报失败,无论是不是管理员都是同样的错

@aweiu
Copy link
Owner

aweiu commented Sep 20, 2022

抱歉,那就不清楚了。插件之所以会执行注册是因为它确实引用不到 dm.dll,或许你可以装个 git-bash 试试,管理员模式下通过它来执行你的 node

@terryvince
Copy link
Author

感谢耐心解答,找到问题了。
我重启后,报dm.dmsoft 未注册类错误。随后我安装了node版本14.18.2 32位版本,重新安装依赖解决

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