I tried Electron 11.0 on MacOS which is same to Windows10, but the problem still.I also tried Electron 16 on Windows10 and it works good.
The message showed in terimal means the $(ProjectName) and other variables($(ElectronVersion,$(MainJS),$(Version)) in the package.json are invalid, I suppose the key point is these variables are not defined on MacOS64,or this is a bug.
First we have to compile the electron project in delphi on Windows with the 'MacOS 64' build option, pas2j will translate the code from pascal to java script, an error message would be shown in console: Build MacOS 64 on Windows is not support, it dose not matter, an output folder 'Build-MacOS64' under the TMSWeb folder will be generated, this is the key point.
Then copy the 'Build-MacOS64' folder to a Mac and run 'npm run builde-mac64' under the folder. The electron-packager can works correct by this way.
It is correct that always the app needs to be compiled from Object Pascal code. This is indeed typically first done from the Delphi IDE and the generated compiled files are then copied to the mac and from there packaged as Electron app.