Closed tworry closed 2 years ago
是的,你说的没错。
我在MDN的文档上又确认了一遍,Node.js 对 optional chainig, nullish coalesing 语法的兼容性是从 V14 开始的:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining#browser_compatibility
根本原因是:https://github.com/JuniorTour/vue-template-babel-compiler/issues/29#issuecomment-1005424023
临时优化方案是:“修改 package.json 中的 engine 字段到 >=14.0.0”
欢迎你随时发个 Pull Request 改一下 😋
在反复切换node版本后确定,只在node14上生效 node12上还是会报错