英文:
Weird syntaxError after electron app packaging : Unexpected token (
问题
我目前正在尝试第一次为我的Electron应用打包,并且遇到了一个奇怪的错误。
在启动app.exe时,出现了以下错误消息:
> 未捕获的异常:
> C:\ .... \build\main.js:39
> electron_1.app.on("ready", async () => {
>
> SyntaxError: 意外的标记 (
> 在 Object.export.runInThisContext (vm.js:76:16) 处
> 在 ...
箭头指向在 app.on
后的括号。
该应用是使用tsc从typescript编译为js(我想这不会影响最终结果),然后使用以下命令打包的:
electron-packager . testApp --platform=win32 --arch=x64 --electron-version=1.4.3
如果能提供帮助,我将不胜感激,因为我真的被这个错误搞得一头雾水。
英文:
I am currently trying to package my electron app for the first time, and I am encountering a weird bug.
When launching the app.exe, this error message appears :
> Uncaught Exception:
> C:\ .... \build\main.js:39
> electron_1.app.on("ready", async () => {
>
> SyntaxError: Unexpected token (
> at Object.export.runInThisContext (vm.js:76:16)
> at ...
The arrow points at the parenthesis right after app.on
.
The app is compiled from typescript to js with tsc (not that this would affect the final result I suppose), then packed with
electron-packager . testApp --platform=win32 --arch=x64 --electron-version=1.4.3
Any help would be appreciated, as I am really stumped by this error.
答案1
得分: 1
好的,以下是翻译好的部分:
"Ok, so turns out the command I was using to package the app was specifying an electron version (unnecessary) different from the one I used. Removing the specific version from the command line fixed it."
英文:
Ok, so turns out the command I was using to package the app was specifying an electron version (unnecessary) different from the one I used. Removing the specific version from the command line fixed it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论