我的打字稿编译器怎么了? `tsc --version`不返回任何内容 [英] What's wrong with my typescript compiler? `tsc --version` returns nothing

查看:91
本文介绍了我的打字稿编译器怎么了? `tsc --version`不返回任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux Mint中,我已经安装了node并用它来安装打字稿.如果安装了有效的打字稿,tsc --version应该返回版本号.就我而言,什么也没有返回.

In Linux Mint, I've installed node and used it to install typescript. With a working typescript installation, tsc --version should return the version number. In my case, nothing is returned at all.

当我运行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并获得了相同的结果,即没有任何结果.

Note I also tried running /usr/local/lib/node_modules/typescript/bin/tsc --version and got the same result ie nothing.

推荐答案

我发现运行node --version不返回任何内容(但不应返回),但是nodejs --version可以工作(结果为v0.10.25).重新安装节点无法解决此问题.我不知道为什么会这样,因为我认为我遵循了建议的安装过程.

I discovered that running node --version returns nothing (but shouldn't) however nodejs --version works (the result being v0.10.25). Reinstalling node didn't fix this. I don't know why this would be the case, as I think I followed the recommended installation procedure.

但是,编辑文件/usr/local/bin/tsc并更改行:

However, editing file /usr/local/bin/tsc and changing the line:

#!/usr/bin/env node

#!/usr/bin/env nodejs

似乎可以工作.现在tsc --version返回message TS6029: Version 1.6.2,我正在运行make时生成.js文件.

seemed to work. Now tsc --version returns message TS6029: Version 1.6.2 and I'm getting .js files generated when I run make.

这篇关于我的打字稿编译器怎么了? `tsc --version`不返回任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆