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

Cannot find module 'ps-list' when in electron and packed on Windows #34

Closed
bruno-robert opened this issue Oct 28, 2019 · 2 comments
Closed

Comments

@bruno-robert
Copy link

I'm trying to integrate ps-list into an electron app that is then packaged using electron-builder.

Everything works fine on mac (both in development and packaged), things start to break only when I try to package the app on windows. Running the .exe will immediately trigger a "Cannot find module 'ps-list'" error.

I've tried excluding ps-list from the asar archive but it's still doesn't work.

"asar": true,
"asarUnpack": [
    "node_modules/ps-list/**/*"
],

When I disable asar completely everything works...

I've done a bit of digging into the code and my guess is the issue comes from the fact ps-list needs to run an executable (only on windows). To do so the executable must be outside the app.asar archive. But since ps-list uses __dirname to get the directory containing the executable, it's still looking at the app.asar/ directory instead of app.asar.unpacked/.

@sindresorhus
Copy link
Owner

This is not the place to ask for Electron help.

@xmsz-stu
Copy link

xmsz-stu commented Sep 4, 2023

any sulotion?

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

3 participants