我正在使用这个问题的打字稿构建以及 sublime text 2 中的构建保存插件来尝试自动编译打字稿:
{
"cmd": ["tsc","$file"],
"file_regex": "(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$",
"selector": "source.ts",
"osx": {
"path": "/usr/local/bin:/opt/local/bin"
}
}
由于以下错误,它永远不会构建。有小费吗?
[Errno 2] No such file or directory
[cmd: [u'tsc', u'/Users/dbrito/Sites/Prototypes/totem-tracker/client/views/layout.ts']]
[dir: /Users/dbrito/Sites/Prototypes/totem-tracker/client/views]
[path: /usr/local/bin:/opt/local/bin]
[Finished]
注意:node 和 npm 是使用 homebrew 安装的。打字稿是随npm -g install typescript
. 我在 10.8.2 上安装了最新的 xcode 和命令行工具。以下是我的.profile
:
export PATH="/usr/local/bin:/usr/local/sbin:~/node_modules/.bin:/usr/local/share/npm/bin:/usr/local/Library/Aliases:${PATH}"
export NODE_PATH="/usr/local/lib/node_modules:${NODE_PATH}"