-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Electron (Packaged): Windows 10 spawn ENOENT error #135
Comments
I am also having the same error after packaging the app.. I did revert back to 1.6.1 but still no luck. Check environment variable and it has "C:\WINDOWS\system32\cmd.exe" in the path variable. any pointer as to how to resolve this issue? Thanks |
@rexn8r what do you mean by packaging the app? |
when i create app package using electron-packager and run the exe with asar file, the plugin throws the error. If i run the electron app in development environment i.e. using npm start command from node.js command window, the plug-in works absolutely fine. the package folder structure created by electron-packager is: app.exe i unpacked the asar file and node module folder did have the screen-shot files. so its not that the packager is missing files. any help would be appreciated. thanks |
There was a fix conducted for Electron in https://github.com/bencevans/screenshot-desktop/releases/tag/v1.5.5. I'm not much doing much with Electron so this isn't a priority for me. However if you work out a fix a pull requested would be very welcome. |
I managed to fix this issue in my project using electron-forge by adding the "asar" => "unpack" option in the packager config:
Not sure if and how this can be applied to this projects package.json directly. Edit: Added the missing "app.manifest" file which needs to be unpacked as well. |
I am using electron-builder to package my application. According to electron-builder documentation, "Node modules, that must be unpacked, will be detected automatically, you don’t need to explicitly set asarUnpack", however screenshot-desktop is not detected by electron-builder so I added this configuration to package.json, and the problem is solved.
Very similar to the solution proposed by @ForsakenNGS |
There seem to be quite a few duplicate issues being opened up which relate to this. If someone's available to, a review of PR #152 from someone more familiar than I with Electron would be appreciated. |
These two posts are exactly right. The .bat file needs to be unpacked along side for the packed version of the electorn app. The bat file can not be executed inside the app.asar file. Additionally adding the files to your windows extra resources worked for me as well. "win": {
"extraResources": [
"node_modules/screenshot-desktop/lib/win32/screenCapture_1.3.2.bat",
"node_modules/screenshot-desktop/lib/win32/app.manifest",
],
} Many solutions to this problem. The solution in #152 assumes the files to be unpacked along side the asar file |
I'm getting the same problems after packing with https://github.com/vercel/pkg/
As suggested by @tance77 I configured pkg to include this 2 files: "pkg": {
"assets": [
"node_modules/screenshot-desktop/lib/win32/screenCapture_1.3.2.bat",
"node_modules/screenshot-desktop/lib/win32/app.manifest"
]
}, I see that they are added from the build debug log, but I'm still getting the same error. Update: |
I don't understand what is the error cause? I tried the above solutions for building the application again with asar unpack but I think it's not working. |
For me this is an issue, if I build the package without |
@MetinYarci thanks a lot it works in production |
thanks.. it's work. |
Hi |
im having this issue currently with https://github.com/vercel/pkg |
please can everyone try my PR #225 i believe this will fix the issued with node bundlers like PKG 👍 |
I'm getting something like that but on Windows 10 (on ubuntu works fine).
https://stackoverflow.com/questions/17951133/spawn-enoent-error
I've switched from 1.7.0 to 1.6.1 and it works on both OS.
The text was updated successfully, but these errors were encountered: