Sublime Text build: cannot find the file specified

2019-02-11 00:56发布

I've installed the CoffeeScript plugin via Package Control. When I try to build test.coffee it gives me this:

[Error 2] The system cannot find the file specified
[cmd:  [u'cake', u'sbuild']]
[dir:  C:\Users\Me\Documents\TestProject]
[path: C:\Users\Me\AppData\Roaming\npm\]
[Finished]

Here's the build in Sublime Text. I'm on Windows and everything CoffeeScript outside of ST2 works correctly.

{
    "cmd": ["cake", "sbuild"],
    "path": "C:\\Users\\Me\\AppData\\Roaming\\npm",
    "selector": "source.coffee",
    "working_dir": "$project_path"
}

The path gives the correct value. The cake script is there. So where's the problem?

3条回答
Anthone
2楼-- · 2019-02-11 01:24

Using Ms Window environment, you could try this:

{
    "windows":
    {
        "cmd": ["cake", "sbuild"],
        "selector": "source.coffee",
        "working_dir": "$project_path"
    }
}
查看更多
Viruses.
3楼-- · 2019-02-11 01:27
  1. Make sure cake is on your DOS path (I assume it is since you said that it works outside ST2)
  2. Remove the line with the path from your ST2 command. This line overwrites your DOS path and that would prevent ST2 from finding the executable.
查看更多
趁早两清
4楼-- · 2019-02-11 01:33

Thanks for the help guys. I've finally found the problem.

On Windows, instead of

"cmd": ["cake", "sbuild"]

it should be

"cmd": ["cake.cmd", "sbuild"]

Instead of modifying it just add:

"windows":
{
    "cmd": ["cake.cmd", "sbuild"]
}

That was subtle...

查看更多
登录 后发表回答