packager icon indicating copy to clipboard operation
packager copied to clipboard

Support pnpm modules

Open lenchvolodymyr opened this issue 3 years ago • 8 comments

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?

lenchvolodymyr avatar Jan 27 '21 09:01 lenchvolodymyr

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

welcome[bot] avatar Jan 27 '21 09:01 welcome[bot]

Any updates?

plimeor avatar Oct 11 '21 09:10 plimeor

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 avatar Dec 07 '21 14:12 mika76

@mika76 I haven't got it working with the shamefully-hoist option. Do you have more detail?

davej avatar Dec 10 '21 13:12 davej

@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

BlackHole1 avatar Oct 08 '22 02:10 BlackHole1

Was there ever official resolution to this? Or is the solution still to use shamefully-hoist / node-linker hoisting? Thanks!

GitMurf avatar Aug 30 '23 00:08 GitMurf

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?

StevenEWright avatar Sep 15 '23 11:09 StevenEWright

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?

kiprobinson avatar Jan 04 '24 01:01 kiprobinson