electron-builder
electron-builder copied to clipboard
Node modules, that must be unpacked, are not detected automatically
- Electron-Builder Version: 22.11.4
- Node Version: 14.17.6
- Electron Version: 18.0.3
- Electron Type (current, beta, nightly):
- Target: any
electron-builder does not unpack node modules in vector-im/element-desktop. "asarUnpack": "**/*.node",
helps as a workaround. As far as I understand they "yarn link" those two node_modules from build directory to the project directory, which makes them symlinks instead of normal directories. Could this be preventing electron-builder from unpacking them?
For your reference: vector-im/element-desktop#337
That sounds like a similar environment/situation as to what pnpm uses. The upstream package is https://github.com/develar/app-builder that parses the dependency tree to generate the list to copy. Unfortunately, it doesn't seem to handle symlinks AFAICT
Which means it is unfixable or should I file yet another issue there? :D
We are having the same problem: https://github.com/WowUp/WowUp/issues/1125
Several other projects too actually, f.e. https://github.com/jitsi/jitsi-meet-electron/issues/556
@mmaietta is there an issue tracking this symlink issue in app-builder?
Not that I'm aware of, I don't manage that project. Please create an issue there with your details
electron-builder
(23.3.3) on Windows doesn't seem to be unpacking normal non-symlink node modules for me. Running this should quickly demonstrate the issue:
git clone [email protected]:electron/electron-quick-start.git && \
cd electron-quick-start && \
npm i native-hello-world && \
npm i -D electron-builder && \
./node_modules/.bin/electron-builder --dir && \
npx asar extract dist/win-unpacked/resources/app.asar app.asar.unpacked && \
ls -al dist/win-unpacked/resources && \
ls -al app.asar.unpacked/node_modules/native-hello-world/build/Release
But the documentation says:
Node modules, that must be unpacked, will be detected automatically, you don’t need to explicitly set asarUnpack - please file an issue if this doesn’t work.
I don't see where in unpackDetector.ts it's detecting node modules to be unpacked. It appears to only detect .dll, .exe, .dylib. .so, ffprobe-static, ffmpeg-static, and binary files that don't have a ".".
I'm having code signing issues because electron not unpacking node_modules nut.js/512