After completing the coding for a beginner Desktop Application in electron, I encountered an issue when trying to package it into an executable .exe file. The error message displayed was:
Command failed: powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('C:\Users\mesba\AppData\Local\electron\Cache\electron-v5.0.6-win32-ia32.zip', 'C:\Users\mesba\AppData\Local\Temp\electron-packager\win32-ia32-template'); }"
In addition, I received a warning at the beginning stating that "--asar" does not accept arguments, only sub-properties.
I attempted to run "npm run package-win" as usual, but it did not work. After searching for solutions, it seemed like there might be an issue with the PowerShell Path variable, however, I am unsure how to resolve this problem.
This is my Package.json:
{ "name": "hello-world", "version": "1.0.0", "description": "", "main": "index.js", ... }The error message reads:
WARNING: --asar does not take any arguments, it only has sub-properties (see --help) Packaging app for platform win32 ia32 using electron v5.0.6
'powershell.exe' is not recognized as an internal or external command, operable program or batch file.
I also encountered the following npm error:
npm ERR! code ELIFECYCLE npm ERR! errno 1 ... PS C:\Users\mesba\Desktop\electron_Projects\Hello World>