[email protected]
windows (NSIS)
When I'm packaging the build using electron-builder I'm getting the issue is
• electron-builder version=20.8.1
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist\electron-builder-effective-config.yaml
• rebuilding native production dependencies platform=win32 arch=x64
• packaging platform=win32 arch=x64 electron=1.8.3 appOutDir=dist\win-unpacked
• default Electron icon is used reason=application icon is not set
• downloading path=C:\Users\admin\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-2.0.0 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.0.0/winCodeSign-2.0.0.7z • cannot move downloaded into final location (another process downloaded faster?) error=rename C:\Users\admin\AppData\Local\electron-builder\cache\winCodeSign\263691235 C:\Users\admin\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-2.0.0: Access is denied. path=C:\Users\admin\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-2.0.0 tempUnpackDir=C:\Users\admin\AppData\Local\electron-builder\cache\winCodeSign\263691235
Error: Exit code: ENOENT. spawn C:\Users\admin\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-2.0.0\rcedit-x64.exe ENOENT
at C:\Users\admin\Desktop\DoctorReponode_modules\builder-util\srcutil.ts:124:16
I'm also try this command in root admin but getting same problem.

For some reasons electron-builder cannot access cache dir. Workaround: set env ELECTRON_BUILDER_CACHE to some another dir.
alternatively in package.json set cache path as follows
"build": {
...
"electronDownload": {
"cache": "... path ..."
}
}
More details in the following document https://github.com/electron-userland/electron-builder/blob/master/docs/configuration/configuration.md
do not help, after digging it appears to me that is anti-virus scanning the newly downloaded assets, thus blocking the file/dir rename/moving operation.
• cannot move downloaded into final location (another process downloaded faster?) error=rename C:\Users\lunay\AppData\Local\electron-builder\Cache\winCodeSign\828651719 C:\Users\lunay\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.4.0: Access is denied. path=C:\Users\lunay\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.4.0 tempFile=C:\Users\lunay\AppData\Local\electron-builder\Cache\winCodeSign\828651719
Error: Exit code: ENOENT. spawn C:\Users\lunay\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.4.0\rcedit-ia32.exe ENOENT
at C:\Users\lunay\Documents\Projects\mgplusdownloadwrappernode_modules\builder-util\srcutil.ts:126:16
at exithandler (child_process.js:301:5)
at ChildProcess.errorhandler (child_process.js:313:5)
at ChildProcess.emit (events.js:189:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
So how can this be fixed?, I have been facing this issue for quite a while now. I first of all thought it was because of the whitespace in my filepath so i created a user without a whitespace in the name but didnt fix the issue. If there is any workaround, i would really appreciate. @develar please could you expatiate on how i could change the cache path.
In case this helps others... I was encountering the same issue, but if I instead ran a command prompt as administrator, then it just worked. Don't know why, but it's something others can try.
Thanks a lot @Jeff-Mott-OR I would like to know if you're using yarn or npm for all your dependendencies or just for electron builder
@yalzeee npm for all.
@Jeff-Mott-OR lastly are you using a windows or mac?
@yalzeee Win
Finally Fixed It. Turns out it was my antivirus that was blocking the process. If you're facing the same problem try to disable real-time scanning and enable it when youre doine with the first build process.
In my case, turing off Windows Defender - Real-time protection saved my ass.
yeah, I turned off my anti-virus application, and it did solve the problem about cannot move downloaded into final location (another process downloaded faster?) error=rename
saved my ass too
just disable anti virus. It works for me.
yes , I close huorong(火绒)and windows defense,It can resolve this problem
Most helpful comment
alternatively in package.json set cache path as follows
More details in the following document https://github.com/electron-userland/electron-builder/blob/master/docs/configuration/configuration.md