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 execute] When pnpm build, occurred %1 is not a valid Win32 application #5638

Open
kooriookami opened this issue Nov 16, 2022 · 10 comments · Fixed by th-ch/youtube-music#1552

Comments

@kooriookami
Copy link

pnpm version:

7.16.0

Code to reproduce the issue:

https://github.com/kooriookami/electron-builder-pnpm

Expected behavior:

Run pnpm build no errors.

Actual behavior:

image

Additional information:

Use sqlite3 in dependencies.

  • node -v prints: v16.16.0
  • Windows, macOS, or Linux?: Win11 x64
@kooriookami
Copy link
Author

When I use npm to build, it works well.
image

@v9u
Copy link

v9u commented Nov 25, 2022

The same questions, demo:https://github.com/v9u/sqlite_test

@v9u
Copy link

v9u commented Nov 26, 2022

The same questions, demo:https://github.com/v9u/sqlite_test

fix way,open pnpm.cjs file, replace #!/usr/bin/env node with #!node,from electron-userland/electron-builder#6933 (comment)

@kooriookami
Copy link
Author

kooriookami commented Nov 26, 2022

The same questions, demo:https://github.com/v9u/sqlite_test

Thanks! You solved my question. I can build electron now. But it still has an error. I will use npm until pnpm solve it.
image

@v9u
Copy link

v9u commented Nov 27, 2022

The same questions, demo:https://github.com/v9u/sqlite_test

Thanks! You solved my question. I can build electron now. But it still has an error. I will use npm until pnpm solve it. image

Because pnpm build not include @mapbox/node-pre-gyp , I don't know why

@v9u
Copy link

v9u commented Nov 27, 2022

The same questions, demo:https://github.com/v9u/sqlite_test

Thanks! You solved my question. I can build electron now. But it still has an error. I will use npm until pnpm solve it. image

I solved the problem,look: https://github.com/v9u/sqlite_test

@kooriookami
Copy link
Author

We may wait for pnpm's reply.

@v9u
Copy link

v9u commented Nov 28, 2022

Yes,but i think it is electron-builder's question,look this:https://www.electron.build/index.html#note-for-pnpm

@AiHaibara
Copy link

AiHaibara commented Dec 5, 2022

The same questions, demo:https://github.com/v9u/sqlite_test

fix way,open pnpm.cjs file, replace #!/usr/bin/env node with #!node,from electron-userland/electron-builder#6933 (comment)

socket.io in electron

⨯ cannot execute cause=fork/exec C:\Users\10200362\AppData\Roaming\npm\node_modules\pnpm\bin\pnpm.cjs: %1 is not a valid Win32 application.
command='C:\Users\10200362\AppData\Roaming\npm\node_modules\pnpm\bin\pnpm.cjs' rebuild [email protected] [email protected]

this can be fixed in my windows by edit 'AppData\Roaming\npm\node_modules\pnpm\bin\pnpm.cjs', but how to let other users auto fix this, all users need change like this?

@thoriqdharmawan
Copy link

The same questions, demo:https://github.com/v9u/sqlite_test

thanks, this works for me 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants