'??' Nullish coalescing Operator 是ECMAScript 2019年的已被采纳的提案,需要 Node.js 15以上才支持。
因此需要升级本地的 Node.js 版本,推荐使用nvm管理本地 Node.js 版本。
参考资料
1、ECMAScript已经完成的提案
2、js特性在Node.js版本中的兼容性
3、nvm
- SyntaxError Unexpected token vite 39syntaxerror unexpected token vite tagoffsetsmap syntaxerror unexpected token unexpected token 39 nvm unexpected token 39 npm unexpected npm token 39 syntaxerror unexpected uncaught页面 codepoint syntaxerror unexpected amp my_customer_index syntaxerror unexpected identifier syntaxerror unexpected uncaught invalid syntaxerror unexpected jconstant uncaught