Node.js version: 12.18.2 (upgraded from 12.13.1 when the issue started)
When running electronize build /target win, the build errors out with: Unknown argument: .
This started today after upgrading the dotnet electronnet.cli tool from 5.30.1 -> 9.31.1, I was running it most of the day doing builds and then suddenly with the same commands and without code changes, started getting this issue. I uninstalled and reinstalled, and did a clean setup on a new windows install with the same versions I had previously running and got the same issue.
Running the command npx electron-builder --config=./bin/electron-builder.json --win --x64 -c.electronVersion=9.0.3
(notice the period is removed), results in it working correctly. This happens on our code base on multiple machines (including clean installs) and it happened on your https://github.comElectronNET/electron.net-api-demos too.
C:\GIT\electron.net-api-demos>electronize build /target win
Build Electron Application...
Build ASP.NET Core App for win-x64...
Executing dotnet publish in this directory: C:\GIT\electron.net-api-demos\obj\desktop\win
Build ASP.NET Core App for win-x64 under Release-Configuration...
Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\GIT\electron.net-api-demos>dotnet publish -r win-x64 -c "Release" --output "C:\GIT\electron.net-api-demos\obj\desktop\win\bin" /p:PublishReadyToRun=true --self-contained
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored C:\GIT\electron.net-api-demos\ElectronNET-API-Demos\ElectronNET-API-Demos.csproj (in 1.59 sec).
ElectronNET-API-Demos -> C:\GIT\electron.net-api-demos\ElectronNET-API-Demos\bin\Release\netcoreapp3.1\win-x64\ElectronNET-API-Demos.dll
ElectronNET-API-Demos -> C:\GIT\electron.net-api-demos\ElectronNET-API-Demos\bin\Release\netcoreapp3.1\win-x64\ElectronNET-API-Demos.Views.dll
ElectronNET-API-Demos -> C:\GIT\electron.net-api-demos\obj\desktop\win\bin\
C:\GIT\electron.net-api-demos>
Start npm install...
Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\GIT\electron.net-api-demos\obj\desktop\win>npm install --production
npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
added 66 packages from 102 contributors and audited 180 packages in 4.035s
found 2 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
C:\GIT\electron.net-api-demos\obj\desktop\win>
ElectronHostHook handling started...
Build Electron Desktop Application...
Executing electron magic in this directory: C:\GIT\electron.net-api-demos\bin\desktop
Create electron-builder configuration file...
Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\GIT\electron.net-api-demos\obj\desktop\win>node build-helper.js electron.manifest.json
C:\GIT\electron.net-api-demos\obj\desktop\win>
Package Electron App for Platform win...
Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\GIT\electron.net-api-demos\obj\desktop\win>npx electron-builder . --config=./bin/electron-builder.json --win --x64 -c.electronVersion=9.0.3
cli.js build
Build
Building:
--mac, -m, -o, --macos Build for macOS, accepts target list (see
https://goo.gl/5uHuzj). [array]
--linux, -l Build for Linux, accepts target list (see
https://goo.gl/4vwQad) [array]
--win, -w, --windows Build for Windows, accepts target list (see
https://goo.gl/jYsTEJ) [array]
--x64 Build for x64 [boolean]
--ia32 Build for ia32 [boolean]
--armv7l Build for armv7l [boolean]
--arm64 Build for arm64 [boolean]
--dir Build unpacked dir. Useful to test. [boolean]
--prepackaged, --pd The path to prepackaged app (to pack in a
distributable format)
--projectDir, --project The path to project directory. Defaults to current
working directory.
--config, -c The path to an electron-builder config. Defaults to
`electron-builder.yml` (or `json`, or `json5`), see
https://goo.gl/YFRJOM
Publishing:
--publish, -p Publish artifacts, see https://goo.gl/tSFycD
[choices: "onTag", "onTagOrDraft", "always", "never", undefined]
Other:
--help Show help [boolean]
--version Show version number [boolean]
Examples:
electron-builder -mwl build for macOS, Windows and Linux
electron-builder --linux deb tar.xz build deb and tar.xz for Linux
electron-builder --win --ia32 build for Windows ia32
electron-builder set package.json property `foo` to
-c.extraMetadata.foo=bar `bar`
electron-builder configure unicode options for NSIS
--config.nsis.unicode=false
Unknown argument: .
C:\GIT\electron.net-api-demos\obj\desktop\win>
... done
Hi.
I have the same problem.
I ran the following command after electronize build command.
npx electron-builder --config=./bin/electron-builder.json --win --x64 -c.electronVersion=9.0.3
Because error said the period is unknown, I erased the period that at after 'electron-builder'.
Hi,
I am having this issue aswell.
Running electronize build /target win, I am getting Error: Unknown argument: .
I've tried on my dev machine and on a fresh machine that hasn't worked with Electron before. Also tried changing electron cli, node versions and building a branch that worked in the morning yesterday. Each time I get Error: Unknown argument: .
Hello,
I also have this problem.
Versions:
Same problem, but I cannot build on Windows (CMD or Terminal) or Linux (WSL2 -HyperV)
I have attached my Makefile and the script file of it running on Ubuntu 18.04 (WSL2-HyperV VM)
In this makefile, I tried to build all the targets (win, linux, osx).
This Makefile has worked for me previously and has made viable builds for Windows and Linux.
All of my codebase is running .NET Core 3.1.
I had to add .txt to my Makefile and scriptfile to attach it to this comment.
Makefile .txt
typescript.txt
Here is a screenshot of some output from the build.
It is this section that I have never seen before.

WSL2 Info:
C:\>wsl --list -v
NAME STATE VERSION
* Ubuntu-18.04 Running 2
Ubuntu WSL2 Info:
rbaker@DESKTOP-EUK8SOJ:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
System Info:
OS Name Microsoft Windows 10 Home
Version 10.0.19041 Build 19041
Processor Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz, 2801 Mhz, 4 Core(s), 8 Logical Processor(s)
BIOS Version/Date American Megatrends Inc. GL703VM.314, 4/29/2019
@GregorBiswanger
@HaydnDias
I summited a PR to fix this issue.
See PR #443
I've noticed this issue is caused by electron-builder, as electronize build runs npm install electron-builder latest v22.7.0 which does not accept "." in the command thus causing the issue. If you try to manually install electron-builder v21 or v20 it will build without issue.
Alternatively, author should remove the "." from the command as well. I don't know what's the purpose of including that "." in the command, can any experienced pros mind sharing? is the "." for Mac or Linux?
I am also facing same problem of unknown argument . in npx electron builder command .Please give some solution.
@zenith6495 @jadhavrani123
I submitted a PR to fix this issue already.
The Gegor, the repo admin, has added it to milestone 9.31.2, so it should work itself out once the milestone gets published.
Hello Community, It is an electron builder problem that has a parameter removed. We got a PR with a solution. I think on Monday version 9.31.2 should be released as soon as possible. Big thanks to @rbaker26 for the PR...
@GregorBiswanger Thank you for the quick update, I thought removing the . was going to be the fix but wasn't fully sure why it was there to begin with, thanks again!
is this solved for latest version? (.net core 3.0)
Most helpful comment
Hello Community, It is an electron builder problem that has a parameter removed. We got a PR with a solution. I think on Monday version 9.31.2 should be released as soon as possible. Big thanks to @rbaker26 for the PR...