node.js - 我的 typescript 编译器有什么问题? `tsc --version` 什么都不返回

标签 node.js typescript linux-mint

在 Linux Mint 中,我安装了 node 并用它来安装 typescript。对于有效的 typescript 安装,tsc --version 应该返回版本号。在我的例子中,什么都没有返回。

当我运行 which tsc 时,结果是 /usr/local/bin/tsc

当我运行 cat/usr/local/bin/tsc 时,结果是:

#!/usr/bin/env node
require('../lib/tsc.js')

当我运行 find/usr/local -name 'tsc*' 时,结果是:

/usr/local/bin/tsc
/usr/local/lib/node_modules/typescript/bin/tsc
/usr/local/lib/node_modules/typescript/lib/tsc.js

这看起来正确吗?如果是这样,那么关于其他要看什么的任何想法将不胜感激?

请注意,我也尝试运行 /usr/local/lib/node_modules/typescript/bin/tsc --version 并得到相同的结果,即什么都没有。

最佳答案

在我使用 Ubuntu 16.04 的情况下,问题是因为我执行了 sudo apt-get install node-typescript,这给我带来了损坏的 tsc。通过 apt-get remove 删除它,然后按照 npm install -g typescript 的建议安装后,它工作正常。

也许这会对某人有所帮助。

关于node.js - 我的 typescript 编译器有什么问题? `tsc --version` 什么都不返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32835203/

相关文章:

node.js - nock 没有拦截我的请求

javascript - Angular 4 : Radiobutton-value disappears after another radiobutton is checked

vim - 在 Linux Mint 上使用 lua 构建 Vim

linux - Samba 给出 "Function not implemented"错误

python - pynotify linux 更改文本

javascript - Visual Studio 2015 编辑器显示 ECMA Script 6 语法错误

node.js - Docker 远程 API 和绑定(bind)

node.js - Telnet:Windows 7 上的本地主机无法连接到本地主机

reactjs - React.FC<Props<T>> 中的 GenericType

node.js - "Type ' 字符串 |字符串[] ' is not assignable to type ' 字符串'