2.21.10
when I excute this command,then message like this-
$ build -mwl
/usr/local/lib/node_modules/electron-builder/node_modules/[email protected]@read-config-file/out/main.js:72
async function readConfig(configFile) {
^^^^^^^^
SyntaxError: Unexpected token function
at Object.exports.runInThisContext (vm.js:78:16)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at _readConfigFile (/usr/local/lib/node_modules/electron-builder/src/cli/cli.ts:10:1)
at Object.args [as handler] (/usr/local/lib/node_modules/electron-builder/src/cli/cli.ts:45:5)
at Object.runCommand (/usr/local/lib/node_modules/electron-builder/node_modules/[email protected]@yargs/lib/command.js:235:44)
at Object.parseArgs [as _parseArgs] (/usr/local/lib/node_modules/electron-builder/node_modules/[email protected]@yargs/yargs.js:1042:24)
at Object.get [as argv] (/usr/local/lib/node_modules/electron-builder/node_modules/[email protected]@yargs/yargs.js:957:21)
at Object.
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
I'm getting the same exact error, and trace output. Also using 20.15.1.
Running as an npm script, "build --dir --x64" ( copied straight from another app which I built successfully a couple of nights ago )
shrugs
We have the same issue with node@6 on Travis:
https://travis-ci.org/jschr/electron-react-redux-boilerplate/jobs/389835142
Same issue here :/
Node 6.11 - NPM 3.10 - electron-build 20.15.1
anyone been able to get this to work? I'm having the same issue...
Same here. This works on one of my Macs and not the other.
Mac not working
NPM: 3.10.10
Node: 7.3.0
electron-build: 20.8.1
Mac working
NPM: 6.1.0
Node: 8.9.4
electron-build: 20.8.1
On the Mac not working, I ran the following
npm install -g npm
brew update
brew upgrade node
I'm now on node version 10.4.0 so it seems like you should have at least Node 8.9.*
I'm not sure what the proper way to upgrade node in Windows. @pronebird I have not had to upgrade node in Travis yet, but doing a quick search, it looks like you should be able to accomplish it.
@lhoezee I think it's simply a misconfiguration issue in the read-config-file package, which is converted from typescript to JavaScript.
Since it's a generated source, its profile can be adjusted to expand the async keywords which aren't supported in node 6.
At the same time electron-builder does not state a minimum node version in its engines section of package.json, so this would be good to add to set the right expectations.
I raised an issue at https://github.com/develar/read-config-file/issues/4
I am OK with dropping node 6 to be fair.
@lhoezee Thank you for your reply. I upgraded the Node version. The problem has been solved.
This issue has been fixed in read-config-file. Please verify with the latest release and close the issue.
Same here. This works on one of my Macs and not the other.
Mac not working
NPM: 3.10.10
Node: 7.3.0
electron-build: 20.8.1Mac working
NPM: 6.1.0
Node: 8.9.4
electron-build: 20.8.1On the Mac not working, I ran the following
npm install -g npm
brew update
brew upgrade nodeI'm now on node version 10.4.0 so it seems like you should have at least Node 8.9.*
I'm not sure what the proper way to upgrade node in Windows. @pronebird I have not had to upgrade node in Travis yet, but doing a quick search, it looks like you should be able to accomplish it.
Hello sir,
I am facing blank white screen issue.. when electron runs for long time(2-3 days) .... my electron(v1.7.16) app going to run 365 days 24 hours...previously i was using ia32 package on 64bit... now m using x64 on 64 bit
node version v8.11.3
npm version 5.6.0
see following cmd....
electron-packager . --overwrite --asar=true --platform=win32 --arch=x64 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName="CompanyName" --version-string.FileDescription=CE --win32metadata.requested-execution-level=requireAdministrator --version-string.ProductName="project_name"
i updated electron --- v4.0.6
m using 64bit windows OS
Packaging app for platform win32 x64 using electron v1.7.16-- command while packaging
Please Help
@lhoezee I think it's simply a misconfiguration issue in the
read-config-filepackage, which is converted from typescript to JavaScript.Since it's a generated source, its profile can be adjusted to expand the
asynckeywords which aren't supported in node 6.At the same time
electron-builderdoes not state a minimumnodeversion in itsenginessection ofpackage.json, so this would be good to add to set the right expectations.I raised an issue at develar/read-config-file#4
I am OK with dropping node 6 to be fair.
Same here. This works on one of my Macs and not the other.
Mac not working
NPM: 3.10.10
Node: 7.3.0
electron-build: 20.8.1Mac working
NPM: 6.1.0
Node: 8.9.4
electron-build: 20.8.1On the Mac not working, I ran the following
npm install -g npm
brew update
brew upgrade nodeI'm now on node version 10.4.0 so it seems like you should have at least Node 8.9.*
I'm not sure what the proper way to upgrade node in Windows. @pronebird I have not had to upgrade node in Travis yet, but doing a quick search, it looks like you should be able to accomplish it.
Hello sir,
I am facing blank white screen issue.. when electron runs for long time(2-3 days) .... my electron(v1.7.16) app going to run 365 days 24 hours...previously i was using ia32 package on 64bit... now m using x64 on 64 bit
node version v8.11.3
npm version 5.6.0
see following cmd....
electron-packager . --overwrite --asar=true --platform=win32 --arch=x64 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName="CompanyName" --version-string.FileDescription=CE --win32metadata.requested-execution-level=requireAdministrator --version-string.ProductName="project_name"
i updated electron --- v4.0.6
m using 64bit windows OS
Packaging app for platform win32 x64 using electron v1.7.16-- command while packaging
Please Help
@amolngt Hello sir, please open the new issue and stop spamming in the unrelated and closed one. Thank you sir.
I wanted to also offer a solution, as I have been running in this issue myself. This for me was happening whenever I ran my electron-builder publish for mac (the windows was working every time), and was within Azure DevOps. This is my package.json for my project.
{
"name": "my-budget",
"productName": "MyBudget",
"version": "1.0.3-beta",
"description": "Free, open source offline cross-platform budgeting solution built with Electron.",
"scripts": {
"build": "concurrently \"yarn build-main\" \"yarn build-renderer\"",
"package-mac": "yarn build && electron-builder build --mac --publish onTagOrDraft",
"package-win": "yarn build && electron-builder build --win --x64 --publish onTagOrDraft"
//....
}
}
I found what I needed to add to my mac build pipeline was installing Node version 10 (this wasn't necessary for my windows pipeline, perhaps because the VM image already had it installed?). Here are my working mac/windows build pipelines for reference.
Mac
trigger:
- master
pool:
vmImage: 'macOS-10.14'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: 'install'
displayName: 'npm install'
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'run package-mac'
displayName: 'npm run package-mac'
Windows
trigger:
- master
pool:
vmImage: 'windows-2019'
steps:
- task: Npm@0
inputs:
command: 'install'
displayName: 'npm install'
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'run package-win'
displayName: 'npm run package-win'
Most helpful comment
I'm getting the same exact error, and trace output. Also using 20.15.1.
Running as an npm script, "build --dir --x64" ( copied straight from another app which I built successfully a couple of nights ago )
shrugs