为什么cmd中的“ tsc -v”不显示打字稿版本?

时间:2019-01-10 11:43:56

标签: typescript

在我的工作电脑中,“ tsc -v”没有显示打字稿版本,而是显示了这个版本。 enter image description here

和“ where tsc”显示此enter image description here

我不了解“ tsc -v”命令的问题。谁能说出问题出在哪里?

1 个答案:

答案 0 :(得分:2)

这正在运行JS tsc.js文件。我猜您想要的是tsc.exe。因此,如果要从命令行使用编译器,请从路径中删除节点位置,或键入tsc.exe

或执行以下操作:

删除npm PATH条目或将npm PATH更改为指向:

......\node_modules\typescript\bin\

代替:

...... \node_modules\typescript\lib\