6

Using Windows XP, I've installed the CoffeeScript plugin on SublimeText2 via Package Control. When I try to build test.coffee I get:

'node' is not recognized as an internal or external command, operable program or batch file.

But entering "node -v" in a cmd console returns "v0.10.0" because my PATH variable contains "C:\Program Files\nodejs\".

I've found threads about people getting stuck in the build stage with SublimeText, but none of those matched my problem. Anyway, here is my CoffeeScript.sublime-build, as it often plays a central role:

{
    "cmd": ["cake", "sbuild"]
    ,"windows":
        {
            "cmd": ["cake.cmd", "sbuild"]
        }
    ,"selector": "source.coffee"
    ,"working_dir": "$project_path"
    ,"path": "C:\\Documents and Settings\\User\\Application Data\\npm"
    ,"variants":
        [
            {
                "name": "Run",
                "cmd": ["coffee", "$file"]
            }
        ]
}  


Update: I got until there thanks to Sublime Text build: cannot find the file specified, whose answer is the same as my other source, this blog and its comments. But I am still stuck.

4
  • In your particular case I can see, that you are having path with spaces. Have you tried to specify path in "short format", e.g. C:\\Docume~1\\User\\Applic~1\\npm?
    – n1ckolas
    Mar 18, 2013 at 17:44
  • Since node it's already on your path, what happens if you remove the path setting in your CoffeeScript.sublime-build file? Mar 18, 2013 at 17:48
  • Short format doesn't solve the problem. Removing the path changes the error message to "The system cannot find the file specified". Mar 18, 2013 at 17:52
  • What puzzles me is: why would people use unix based paths? Is my nodejs, sublime text2 or npm installation faulty? nodejs is in my Path (system variables), npm is in my PATH (user variables). Mar 18, 2013 at 18:05

2 Answers 2

2

Actually this similar problem and solution work, you just need to close and reopen Sublime Text for it to take effect. Because editing CoffeeScript.sublime-build and building iteratively will mess with Sublime's "path" variable.
Thanks to those who gave ideas, sorry for the trivial problem.

0

Making sure that lessc is added to your Environment Variables -> Path variable. The lessc directory should be listed in the PATH. This will ensure that you can use it anywhere on the cmd line. Also ensure if you have the cmd line open you will need to close it and reopen it for things to take effect.

After this you can type c:> lessc on the command line and options will be shown to you how to run.

c:> lessc -h

usage: lessc [option option=parameter ...] [destination]

If source is set to `-' (dash or hyphen-minus), input is read from stdin.

options: -h, --help Print help (this message) and exit. --include-path=PATHS Set include paths. Separated by :'. Use;' on Window s. -M, --depends Output a makefile import dependency list to stdout --no-color Disable colorized output.

....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.