【发布时间】:2020-02-19 13:46:54
【问题描述】:
我正在使用 Cordova,但在 Android API 23 (6 Marshmallow) 中有语法错误。
在 API 28(9 Pie)和 API 21(5 Lollipop)上一切正常,但在 API 23 上,我有这些错误:
Uncaught SyntaxError: Unexpected token =>
Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
Uncaught SyntaxError: missing ) after argument list
我使用的是原版 JS,没有别的。
有什么问题?我该如何解决?
【问题讨论】:
-
你使用的node版本是什么?
-
@Prawinsoni 我正在使用 v12.13.0
-
好的,问题出在节点 5 上。您尝试使用严格模式了吗?
-
@Prawinsoni 显然问题是 ES6 在 API 23 中的不兼容,“严格模式”也是一个问题。我找到了解决方案,但它可能不适用于旧手机。
标签: javascript cordova android-6.0-marshmallow