找不到`node-screenshots.win32-x64-msvc.node`文件
mushan0x0 opened this issue · 6 comments
mushan0x0 commented
在win x64设备上打包,但是部分win设备无法使用,报错:
[2023-05-12 14:57:44.619] [info] localFilePath G:\Ordinary\chat gpt\AI 0x0\resources\app.asar\node_modules\node-screenshots\node-screenshots.win32-x64-msvc.node true
[2023-05-12 14:57:45.258] [error] (node:14764) UnhandledPromiseRejectionWarning: Error: The specified module could not be found.
\\?\C:\Users\Administrator\AppData\Local\Temp\e148b8e2-66ed-4a59-9afc-074a6d7c7acc.tmp.node
at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
at Module._extensions..node (node:internal/modules/cjs/loader:1326:18)
at Object.func [as .node] (node:electron/js2c/asar_bundle:2:2049)
at Module.load (node:internal/modules/cjs/loader:1096:32)
at Module._load (node:internal/modules/cjs/loader:937:12)
at f._load (node:electron/js2c/asar_bundle:2:13330)
at Module.require (node:internal/modules/cjs/loader:1120:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (G:\Ordinary\chat gpt\AI 0x0\resources\app.asar\node_modules\node-screenshots\index.js:72:29)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
我手动把node-screenshots.win32-x64-msvc.node
文件放到node-screenshots
目录下,localFilePath
判断返回的是true
,但还是说The specified module could not be found
对应版本
nashaofu commented
node-screenshots.win32-x64-msvc.node 是放在 node-screenshots-win32-x64-msvc 下的。https://www.npmjs.com/package/node-screenshots-win32-x64-msvc?activeTab=code
mushan0x0 commented
是的,手动装了这个包也是这样的提示
nashaofu commented
app.asar 解压后没有这个文件吗?你应该需要打包的时候把相关依赖加入到app.asar中
mushan0x0 commented
nashaofu commented
在有问题的windows上,不打包运行有问题吗
mushan0x0 commented
我的设备都是好的,有问题的是部分电脑,我觉得可能跟electron-builder或者别的有关吧,可能不关这个库的事。。。。感谢