在Sublime Text 2中运行CoffeeScript时出错

时间:2015-07-20 15:41:13

标签: coffeescript sublimetext2

我是CoffeeScript和Sublime Text 2的新手,所以非常感谢任何帮助。

当我尝试在Sublime中编译CoffeeScript测试文件时,收到以下错误消息:

    [Error 2] The system cannot find the file specified
    [cmd:  [u'coffee', u'-c', u'C:\\Users\\username\\Desktop\\test.coffee']]
    [dir:  C:\Users\username\Desktop]
    [path: $HOME/bin:/usr/local/bin:$HOME/bin:/usr/local/bin:C:\Program Files (x86)\ImageMagick-6.9.1-Q16;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_25\bin;C:\Java\bin;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\nodejs\;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\git\cmd;C:\Program Files (x86)\Skype\Phone\;C:\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby2.1.0\bin;C:\Users\username\AppData\Roaming\npm]

[Finished]

以下是命令中的构建设置:

    {
    "path": "$HOME/bin:/usr/local/bin:$PATH",
    "cmd": ["coffee","-c","$file"],
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "selector": "source.coffee, source.litcoffee, source.coffee.md"
}

知道如何解决这个问题吗?感谢。

1 个答案:

答案 0 :(得分:0)

我设法让它在构建文件中使用以下代码:

{
   "cmd": [ "coffee", "-m", "-c", "$file" ],
   "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
   "selector": "source.coffee, source.litcoffee, source.coffee.md",

   "windows":
   {
      "shell": true
   }
}