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

pnpm monorepo build error #6933

Closed
gjfei opened this issue Jun 10, 2022 · 11 comments
Closed

pnpm monorepo build error #6933

gjfei opened this issue Jun 10, 2022 · 11 comments

Comments

@gjfei
Copy link

gjfei commented Jun 10, 2022

  • Electron-Builder Version: 23.0.3
  • Node Version: 16.13.2
  • Electron Version: 19.0.4
  • Electron Type (current, beta, nightly):
  • Target: window

image

reproduction

@gjfei
Copy link
Author

gjfei commented Jun 10, 2022

help me

@mmaietta
Copy link
Collaborator

mmaietta commented Jul 4, 2022

Are we sure that is an issue with electron-builder? It seems to be saying your pnpm installation is not a valid win32 application. Can you try node 14 or a newer version of node 16?

@hipstersmoothie
Copy link

This is the same issue as this #6289

Which is because of this issue that's been fixed in app-builder develar/app-builder#63

But hasn't been pulled in because:

develar/app-builder#83
#6684

@mmaietta
Copy link
Collaborator

Does this workaround work correctly for monorepos?
https://www.electron.build/#note-for-pnpm

@hipstersmoothie
Copy link

Checking on that now. But using any of those options kills most of the usefulness of pnpm. Proper support would be a huge improvement. Is there an issue tracking that?

@mmaietta
Copy link
Collaborator

#6933 (comment)
We're blocked from updating by develar/app-builder#83

@MasterOdin
Copy link

I was running into a similar issue (reported as #7029), but with yarn, and had a similar root cause where the .yarn/releases/yarn-*.cjs file we had checked into our repo had a #!/usr/bin/env node shebang. I found that on changing the shebang to be just #!node, I was able to fix my build issues.

Perhaps possible to do a similar hack to pnpm/bin/pnpm.cjs file as an immediate workaround, though ideally could update app-builder and have that be fixed there.

@rafaberaldo
Copy link
Contributor

rafaberaldo commented Aug 22, 2022

Having the same problem, the workaround is calling pnpm electron-builder instead of a package script.


I could make it work without the node-linker=hoisted (which is is the whole point of using pnpm) option, my .npmrc currently is:

strict-peer-dependencies=false
shamefully-hoist=true

I run the build process for the renderer, and then pnpm electron-builder -- calling it in script throws not a valid win32 application.

I also had to move electron-* packages (electron-updater, etc.) to deps instead of devDeps.


Edit:

Tested in another env and it's actually not working without node-linker=hoisted. Maybe I had some leftover files in node_modules.

@kooriookami
Copy link

Still have this problem, I have to use npm build it.

@ramiel
Copy link

ramiel commented Sep 22, 2023

Why is this issue still present? The bugfix on app-builder should be deployed already

@mmaietta
Copy link
Collaborator

@ramiel because the dependency update is still broken
See: #7774

And comment requesting help from @develar to resolve the issue in app-builder
develar/app-builder#83 (comment)

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

7 participants