-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix "Error spawn ENOENT" when package using "pkg" #56
base: master
Are you sure you want to change the base?
Conversation
Thank you for PR @lupohan44 I've never used vercel/pkg. But this fix looks like a workaround. Is there a way to copy 7zip to the temp folder only if it is pkg? Otherwise, use the current implementation? |
This sounds like a good idea, I will look into it.
…---- Replied Message ----
| From | Mykhailo ***@***.***> |
| Date | 6/12/2022 16:38 |
| To | ***@***.***> |
| Cc | ***@***.***> ,
***@***.***> |
| Subject | Re: [onikienko/7zip-min] Fix "Error spawn ENOENT" when package using "pkg" (PR #56) |
Thank you for PR @lupohan44
I've never used vercel/pkg. But this fix looks like a workaround. Is there a way to copy 7zip to the temp folder only if it is pkg? Otherwise, use the current implementation?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi @lupohan44 As I understand you can't use |
Yes, I noticed that comment too, but I can actually use fs.copyFileSync in pkg (as I tested). I guess that was a glitch and has been fixed.
…---- Replied Message ----
| From | Mykhailo ***@***.***> |
| Date | 6/14/2022 17:44 |
| To | ***@***.***> |
| Cc | ***@***.***> ,
***@***.***> |
| Subject | Re: [onikienko/7zip-min] Fix "Error spawn ENOENT" when package using "pkg" (PR #56) |
Hi @lupohan44
Thank you for the updates. Meanwhile reading the issue you have mentioned I noticed this comment vercel/pkg#342 (comment)
As I understand you can't use fs.copyFileSync too. But have to read assets into memory then write them into disk .
Did you test your code with pkg?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I see. Interesting. Will try to check my own. |
I'm getting this same error in my electron app:
|
You can apply this patch into your project manually, it should fix your problem. |
When using "pkg" to package it into binary file, we will get "Error spawn ENOENT" like vercel/pkg#342
This commit copy 7zip to a temperary folder and execute the 7zip from there to avoid this issue