![](/img/trans.png)
[英]Pros and Cons for using tsc to transpile TypeScript to JavaScript using tsc command
[英]Typescript command “tsc” undefined. Tried every known solution
欢迎,我不能整天运行Typescript。 我使用Visual Studio Code。 我正在做的是在全球范围内安装TS:
$ npm install -g typescript
然后,当我检查它:
$ tsc
在所有情况下,我都会收到该错误:
bash:tsc:找不到命令
到那时,我已经尝试了以下解决方案:
$ npm config set prefix /usr/local
在npm root -g
之后,我得到的是:
C:\\ Program Files \\ Git \\ usr \\ local \\ node_modules
通过相对方式设置npm config获取(我知道):
C:\\ usr \\ local \\ node_modules
设置.bash_profile:
export PATH=/usr/local/share/npm/bin:$PATH
用PATH设置.bashrc也...
将Typecript安装为dev依赖项也不起作用。
我什至不记得的其他小型解决方案。
请寻求帮助。 我可以提供您需要的更多信息-随便说些什么。
尝试了每个已知的解决方案
PATH
) npm install typescript -g
🎊🌹
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.