electron-builder
electron-builder copied to clipboard
pnpm monorepo build error
- Electron-Builder Version: 23.0.3
- Node Version: 16.13.2
- Electron Version: 19.0.4
- Electron Type (current, beta, nightly):
- Target: window
help me
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?
This is the same issue as this https://github.com/electron-userland/electron-builder/issues/6289
Which is because of this issue that's been fixed in app-builder https://github.com/develar/app-builder/issues/63
But hasn't been pulled in because:
https://github.com/develar/app-builder/issues/83 https://github.com/electron-userland/electron-builder/pull/6684
Does this workaround work correctly for monorepos? https://www.electron.build/#note-for-pnpm
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?
https://github.com/electron-userland/electron-builder/issues/6933#issuecomment-1197434288 We're blocked from updating by https://github.com/develar/app-builder/issues/83
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.
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.
Still have this problem, I have to use npm build it.
Why is this issue still present? The bugfix on app-builder should be deployed already
@ramiel because the dependency update is still broken See: https://github.com/electron-userland/electron-builder/pull/7774
And comment requesting help from @develar to resolve the issue in app-builder https://github.com/develar/app-builder/issues/83#issuecomment-1716257591