显示"tsc"命令时出现"SyntaxError: Unexpected token ?"
<p>我是打字稿新手,
我尝试通过运行命令 <code>tsc filename.ts</code> 将打字稿文件转换为 javascript 文件。
但它显示错误。</p>
<pre class="brush:php;toolbar:false;">C:Program Files (x86)Nodistbinnode_modulestypescriptlibtsc.js:93
for (let i = startIndex ?? 0; i < array.length; i++) {
^
SyntaxError: Unexpected token ?
at Module._compile (internal/modules/cjs/loader.js:749:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
at Module.load (internal/modules/cjs/loader.js:672:32)
at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
at Function.Module._load (internal/modules/cjs/loader.js:604:3)
at Module.require (internal/modules/cjs/loader.js:711:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object.<anonymous> (C:Program Files (x86)Nodistbinnode_modulestypescriptbintsc:2:1)
at Module._compile (internal/modules/cjs/loader.js:805:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)</pre>
<p>我尝试将节点安装到最新版本。</p>