dusionlike / electron-builder-encryptor

simple electron package encryption tool
MIT License
24 stars 7 forks source link

The specified module could not be found #7

Closed jincandev closed 1 year ago

jincandev commented 1 year ago

我的项目中引用了.node文件,在未使用electron-builder-encryptor前,打包后electron程序可正常运行,但使用后却提示出错,错误信息如下:

Uncaught Exception:
Error: The specified module could not be found.
\\?\C:\Users\Nardy\AppData\Local\Temp\9a606748-1d6f-4f6f-9b04-868284225d16.tmp.node
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
    at Module._extensions..node (node:internal/modules/cjs/loader:1259:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:2:2049)
    at Module.load (node:internal/modules/cjs/loader:1044:32)
    at Module._load (node:internal/modules/cjs/loader:885:12)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1068:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (G:\Gitee\electron-vite\release\1.0.0\win-unpacked\resources\app.asar\node_modules\@jincan\iohook\index.cjs.js:4:21)
    at Module._compile (node:internal/modules/cjs/loader:1174:14)

我检查过,在运行使用electron-builder-encryptor生成的程序时,C:\Users\Nardy\AppData\Local\Temp\9a606748-1d6f-4f6f-9b04-868284225d16.tmp.node这个文件是存在的 我的系统是:Windows 11 NodeJS版本: v19.6.1

dusionlike commented 1 year ago

抱歉,工作忙忘了回复。 我的程序也有使用原生模块,没有出现过你的问题。 我先关闭这个issue,如果你的问题还没解决的话,麻烦你提供一份最小复现的代码,我会重新打开这个issue并尝试着帮你解决。