I'm am using electron-packager 8.5.1 with Electron 1.4.13 (also tried using 1.2.2), attempting to build on Windows 10 for Windows.
I keep getting the following:
λ electron-packager . app --platform=win32 --arch=x64
Packaging app for platform win32 x64 using electron v1.4.13
rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes
While I'm aware that electron-packager comes with rcedit, I've downloaded rcedit from the electron/rcedit repos and placed it into my path to ensure I can execute rcedit and it isn't a pathing issue.
I can't find much through google or the issues of electron-packager or rcedit, so I was hoping someone would have an idea on what I can do from here.
On a hunch I rolled back to electron-packager 7.0.0. The build works fine, though it errors out on an lstat, the resulting app.exe is still there with no performance issues. I will try and locate when this issue was initially brought in.
The issue was introduced in release 7.7.0 - version 7.6.0 does the build fine as previously stated.
That doesn't make any sense to me. Here are the changes between 7.6.0 and 7.7.0: https://github.com/electron-userland/electron-packager/compare/v7.6.0...v7.7.0
Here's the error message in the rcedit.exe source: https://github.com/electron/rcedit/blob/1c9920ac153e6d4cd2d63ddb4148a323e4b94d2e/src/main.cc#L107-L108
I am not a Windows dev, so I would suggest filing a bug in the rcedit issue tracker and seeing if someone responds.
Agreed, I was just looking through commits between tags 7.6.0 and 7.7.0 and it seems to be minimal changes. BUT I just removed 7.6.0 and re-installed 7.7.0 - same result, albeit different presentation than the latest version.
λ electron-packager . app --platform=win32 --arch=x64
Packaging app for platform win32 x64 using electron v1.4.13
Fatal error: Unable to commit changes
undefined
rcedit is brought in through node-rcedit - is there a difference in the version being pulled down between 7.7.0 and 7.6.0 that I'm not seeing to narrow down the problem in rcedit?
Where is your project located? In your home directory? Have you tried to disable MS Defender or another antivirus?
....and the answer is no, both request ^0.5.1.
My 7.7.0 install install and 7.6.0 install also have 0.5.1 rcedit in their node_modules, so its not a problem with versioning of rcedit. I've also confirmed that 7.6.0 will build where 7.7.0 does not. I'm at a loss.
@hlfshell I think I know what the problem is. Could you link a gist of your package.json file?
Where is your project located? In your home directory? Have you tried to disable MS Defender or another antivirus?
I'm on a company computer, so there is antivirus via Cylance. I can try building the project tonight on a personal computer without the antivirus to see if there's a difference.
I'm performing the build in C:\Users\myuser\project-folder\
@hlfshell I think I know what the problem is. Could you link a gist of your package.json file?
Here you go!
{
"name": "radio-distance-tester",
"version": "1.0.0",
"description": "Tester app for featherwing LoRa radio devices",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": {
"email": "[email protected]",
"name": "my name"
},
"license": "Private",
"dependencies": {
"electron-prebuilt": "^1.4.13",
"serialport": "^4.0.7"
},
"devDependencies": {
"electron-rebuild": "^1.5.7"
}
}
I HAVE done the electron-rebuild process for serialport, though not every time. Could that be a cause?
@hlfshell FYI, you should remove electron-prebuilt and put electron in your devDependencies. But that's not relevant to your issue.
Hmmm. So I figured the problem was that in 7.7.0, we started using version in package.json to set ProductVersion and FileVersion in the Windows app executable. I haven't tested this, but try setting --app-version= (blank) and see what happens.
@malept Unfortunately that's a no-go. Re-installed v7.7.0:
λ electron-packager . app --platform=win32 --arch=x64 --app-version=0.0.1
Packaging app for platform win32 x64 using electron v1.4.13
Fatal error: Unable to commit changes
undefined
@hlfshell oh, leave it as --app-version=, don't set a value if possible. It's probable that it might not actually work, though.
Sorry, my mistake. Re-ran:
λ electron-packager . app --platform=win32 --arch=x64 --app-version=
Packaging app for platform win32 x64 using electron v1.4.13
Fatal error: Unable to commit changes
undefined
Same result, I'm afraid.
@hlfshell Do you happen to have access to a different machine? It can have the same antivirus or whatever.
Yes, I will try to build elsewhere and will report back. Searching for a difference or do you have an idea in mind?
Just searching for a difference. Also, If you have access to a Mac/Linux machine, I think that would solve your problem. (assuming you install Wine, etc.)
Afraid the only Linux boxes I have are raspberry pis, so that would prove difficult to build from.
Will report back with a different machine in a bit.
I found this, it might be related: https://github.com/electron/node-rcedit/issues/6#issuecomment-157574430
I found that earlier, and created a .ico using an online convereter in case it was as simple as not providing an icon. But let's give it a try with everything else we've done so far. Using v7.7.0:
Packaging app for platform win32 x64 using electron v1.4.13
Fatal error: Unable to commit changes
undefined
No-go I'm afraid.
I was more referring to the comment that it supposedly doesn't work with Node, but does if you invoke rcedit directly.
I am having a similar problem. I have just started with electron-packager and am a new member here at Github. If this is different, let me know and I will start a new issue.
I sometimes get the error above, but also get the more frequent error:
ERR! Error: EPERM: operation not permitted, rmdir c:\Users\Jon\Desktop\Test\distwin32a\mytest1-win32-x64\resources\app\node_modues
My script is:
"build-win32": "electron-packager . --electron-version 1.4.15 --tmpdir=false --platform win32 --icon ./assets/icon.ico --out ./distwin32a --overwrite"
My package is:
{
"name": "mytest1",
"version": "1.0.0",
"description": "MyTest2",
"main": "main.js",
"scripts": {
"start": "electron main.js",
"build-all": "electron-packager . --electron-version 1.4.15 --tmpdir=false --platform all --icon ./assets/icon --out ./dist",
"build-win32": "electron-packager . --electron-version 1.4.15 --tmpdir=false --platform win32 --icon ./assets/icon.ico --out ./distwin32a --overwrite",
"build-linux": "electron-packager . --electron-version 1.4.15 --tmpdir=false --platform linux --icon ./assets/background.png --out ./distlinux --overwrite",
"build-osx": "electron-packager . --electron-version 1.4.15 --tmpdir=false --platform darwin --icon ./assets/icon.icns --out ./distdarwin --overwrite"
},
"private": true,
"build": {
"appId": "mycomany.myproduct"
},
"keywords": [
"Stuff",
"Stuff"
],
"author": "JAA17",
"license": "SEE LICENSE IN LICENSE.TXT",
"devDependencies": {
"electron-packager": "^8.5.1"
}
}
The only thing I have in the background is Visual Studio where I do my code editing.
@JAA17 The EPERM error is a different error, please file a different issue.
Just wanted to comment that I also encountered this error and rolling back also solved the issue for me. I work with @hlfshell and another, third coworker just ran into this problem, so at this point it's safe to say this has something to do with our dev setup. Cylance (network antivirus) seems like a likely culprit to me.
At this point I would suggest trying to use Electron Packager with the network shut off (assuming you already have prebuilt Electron cached on the machine), given your network antivirus comment.
We've re-imaged our systems due to a company buyout, and the problem magically went away.
I've confirmed now on two other systems that this does not occur in Windows 10. This leads me to believe that something locally in our company caused the issue. Not sure why, since there was no difference in the rcedit executables between our versions.
Let's close this issue unless someone else ever runs into it.
Thanks for the help everyone!
I'm having this same issue on macOS 10.12.4. I'm using wine v2.0.1 from homebrew, electron v1.6.6 and electron-packager v8.6.0 from npm.
pennies > electron-packager . pennies --platform=win32 --arch=x64
Packaging app for platform win32 x64 using electron v1.6.6
rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes
Building for macOS works fine. I tried the above suggestion of using --app-version= but the result is the same. There are no antivirus or security programs running to interfere.
@mikezila has it ever worked for you? Is it possible to try using a real Windows machine, a Windows VM, or an earlier version of Wine?
Trying it on a Windows 7 vm with a 100% fresh install of node and friends seems to work fine.
I was previously using wine 2.0.1, when I used homebrew to swap to an earlier version (2.0) it seemed to work fine, but still failed once I swapped back to 2.0.1. Doing a brew info wine it looked like the latest version (2.0.1) was installed twice somehow. Doing brew uninstall --force wine to remove them all and then just doing brew install wine to get the latest again seems to have fixed it. If future internet travelers find this I suggest giving the above a try. Wine was otherwise working fine, but doing a forced uninstall and reinstall fixed it regardless.
Thanks for you reply.
@mikezila , how did you get to finally fix packaging win32 on your mac? I am facing this issue. packaging for macOS works fine. This used to work smoothly on my previous machine before i did a time-machine backup and restored into another mac just last week. I have tried out all tips i have found on the internet.
I ran a brew info wine after installing a fresh one. I noticed this:
==> Dependencies
Build: pkg-config ✘, cmake ✘, makedepend ✘
looks like these dependencies are missing. could this have caused my challenges packaging for windows ?
Pls, help. thanks.
Just restart your machine. It is due to Windows permission issue. I tried to set permission for that folder. But I was not able to.
Then restarted machine The issue got resolved. :)
I'm seeing this come up at least 3 times a day on my CI machines, where rebooting 3 times a day isn't really all that realistic. Can anyone clarify which files or folders windows is supposedly taking a lock on or having permissions problems with? Is there anything I can do to make the whole process a bit more robust so that I can have some dependable builds again?
@ronnyek did u solve this? same thing here.
I do experience the same thing, it worked once and after that it doesn't work. Removing the dist folder manually did not work either.
+1.
Build multiple times, and error happens occasionally. Totally don't know why.
Got the same error:
rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes
rcedit.exe to McAfee's Excluded Files, re-enabled RT Scan and it worked.Hope this helps someone.
Disabling the Antivirus worked for me!
Disabling the Antivirus worked for me too!
I was having the same issue, turns out it was due to the Windows Ransomware protection. Disabling it solved the issue for me.
rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes
禁用掉防病毒软件windows防火墙再打包就ok了!
rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes
禁用掉防病毒软件windows防火墙再打包就ok了!
呵呵哒,确实是这样,把所有的电脑管家和防火墙关了就ok了。
- Disabled McAfee's real-time scanning and it worked.
- Added
rcedit.exeto McAfee's Excluded Files, re-enabled RT Scan and it worked.Hope this helps someone.
Thank you so much. This solved my problem! The rcedit.exe to add to your exclude list is located within node_modules\rcedit\bin within your app directory.
Thank you so much. This solved my problem
is there any workaround for Cyclance security software? I'm having the same issue on Windows 10, version
electron-builder version=22.4.1 os=10.0.17763
platform=win32 arch=x64 electron=8.2.0 appOutDir=build\win-unpacked
arget=portable file=build\MY_APPLICATION.exe archs=x64
For the ones that have the issue while using Windows OS and default antivirus (Defender) the steps below will resolve your issue.
Add an exclusion and pick the Processrcedit.exe into the prompt and save
Most helpful comment
Disabling the Antivirus worked for me!