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

Node modules, that must be unpacked, are not detected automatically #6792

Open
PF4Public opened this issue Apr 13, 2022 · 7 comments
Open

Node modules, that must be unpacked, are not detected automatically #6792

PF4Public opened this issue Apr 13, 2022 · 7 comments

Comments

@PF4Public
Copy link

  • 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: element-hq/element-desktop#337

@mmaietta
Copy link
Collaborator

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

@PF4Public
Copy link
Author

Which means it is unfixable or should I file yet another issue there? :D

@ilu33
Copy link

ilu33 commented Apr 17, 2022

We are having the same problem: WowUp/WowUp#1125

Several other projects too actually, f.e. jitsi/jitsi-meet-electron#556

@hipstersmoothie
Copy link

@mmaietta is there an issue tracking this symlink issue in app-builder?

@mmaietta
Copy link
Collaborator

mmaietta commented Jul 28, 2022

Not that I'm aware of, I don't manage that project. Please create an issue there with your details

@jeremyspiegel
Copy link
Contributor

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 ".".

@freddy-daniel
Copy link

freddy-daniel commented May 30, 2023

I'm having code signing issues because electron not unpacking node_modules nut.js/512

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

6 participants