packager
packager copied to clipboard
Support pnpm modules
Preflight Checklist
- [x ] I have read the contribution documentation for this project.
- [ x] I agree to follow the code of conduct that this project follows, as appropriate.
- [ x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
When modules installed with pnpm the pruning leads to an error like this:
Error: Failed to locate module "@azure/abort-controller" from "/home/volodymyr/projects/hackolade_pnpm/node_modules/@azure/storage-file-datalake"
This normally means that either you have deleted this package already somehow (check your ignore settings if using electron-packager). Or your module installation failed.
It happens because pnpm stores modules under .pnpm folder and creates symlinks only for modules in "dependencies" and "devDependencies", and probably electron-packager
cannot find them.
Proposed Solution
Fix the searching of modules under the symlinks and preserve node_modules that symlinks are linked to.
Additional Information
Actually, I found the PR that fixes looking to symlinks: https://github.com/MarshallOfSound/flora-colossus/pull/16
But it doesn't preserve the origin folders, so after the packaging, it leads to broken symlinks in the node_modules folder.
So I'm wondering is there a plan to support pnpm modules structure for electron projects?
👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
Any updates?
Also interested in this. I don't suppose there's any news?
Note: It seems to work if you use the shamefully-hoist
option of pnpm: https://pnpm.io/npmrc#shamefully-hoist
@mika76 I haven't got it working with the shamefully-hoist
option. Do you have more detail?
@mika76 I haven't got it working with the
shamefully-hoist
option. Do you have more detail?
https://github.com/electron-userland/electron-builder/issues/6289#issuecomment-1042620422
Was there ever official resolution to this? Or is the solution still to use shamefully-hoist
/ node-linker
hoisting? Thanks!
https://github.com/develar/app-builder/issues/84#issuecomment-1715226680
Looks like a solution was committed and is just awaiting a new release of app-builder
?
develar/app-builder#84 (comment)
Looks like a solution was committed and is just awaiting a new release of
app-builder
?
I'm still seeing this issue on Windows and MacOS... any update?