Vscode-code-runner: 运行 typescript时 输出乱码

Created on 17 Jun 2020  ·  2Comments  ·  Source: formulahendry/vscode-code-runner

版本是最新版的vscode 64位
enum Gender{
BOY,
GIRL
}
[Done] exited with code=0 in 0.176 seconds

[Running] ts-node "f:0000-2020-myproject05-react02ts+react01mystudy\1.ts"
'ts-node' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�����������

[Done] exited with code=1 in 0.07 seconds;

如果在setting.json 中配置
{ "code-runner.runInTerminal": true }
则会出现下面问题
image

Most helpful comment

  1. 全局安装 typescript 和 ts-node
    npm i -g typescript ts-node
  2. 使用命令获取 npm config get prefix 获取 ts-node安装地方 C:\Users\xxx\AppData\Roamingnpm
  3. 将2获得的路径添加到环境变量path中
  4. 重启电脑即可

All 2 comments

  1. 全局安装 typescript 和 ts-node
    npm i -g typescript ts-node
  2. 使用命令获取 npm config get prefix 获取 ts-node安装地方 C:\Users\xxx\AppData\Roamingnpm
  3. 将2获得的路径添加到环境变量path中
  4. 重启电脑即可

哈 你可是看的珠峰视频 我也正好遇到了这个问题

Was this page helpful?
0 / 5 - 0 ratings