gpt4 book ai didi

linux - Typescript 在 Linux 上构建 Sublime Text 3 - [Errno 20] 不是目录

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:28:54 24 4
gpt4 key购买 nike

尝试使 TypeScript 的构建系统在 Ubuntu 上的 Sublime Text 3 上运行。

运行时

tsc 

在终端上它工作正常。 (打印版本 1.5.0-beta语法:tsc [选项] [文件...])

运行时:

which tsc

它说:

/home/antti/npm/bin/tsc

但是,当在 ST3 构建器上构建 ts 文件时,它说:

[Errno 20] Not a directory
[cmd: ['tsc', '/home/antti/code/greeter.ts']]
[dir: /home/antti/code]
[path: /home/antti/npm/bin/tsc]
[Finished]

这是我的 Typescript.sublime-build 配置文件:

{
"cmd": ["tsc","$file"],
"file_regex": "(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$",
"selector": "source.ts",
}

最佳答案

在您的配置文件中定义一个 path 键,如下所示:

{
"cmd": ["tsc","$file"],
"file_regex": "(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$",
"selector": "source.ts",
"path": "/home/antti/npm/bin/"
}

重要的部分不是指向可执行文件(.../bin/tsc)而是指向目录(.../bin/)。

关于linux - Typescript 在 Linux 上构建 Sublime Text 3 - [Errno 20] 不是目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30394306/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com