CoffeeScript and Cake

I installed CoffeeScript on my machine with npm install -g coffee-script I get the following message when I check cake version:

$ coffee -v
CoffeeScript version 1.3.3
$ cake -v
path.existsSync is now called `fs.existsSync`.

    throw new Error("Cakefile not found in " + (process.cwd()));
Error: Cakefile not found in /Users/Phil
    at cakefileDirectory (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/cake.js:108:11)
    at cakefileDirectory (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/cake.js:106:14)
    at cakefileDirectory (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/cake.js:106:14)
    at (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/cake.js:49:19)
    at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/coffee-script/bin/cake:7:38)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)

Does anyone know how can I fix this?


  • There are two issues here.

    The first is a known issue which causes:

    path.existsSync is now called `fs.existsSync`

    You can find out more about the issue here:

    As stated in the pull request, it should be fixed in the coffee-script master branch. So you can download the latest source from GitHub and it should resolve the issue for you.

    Otherwise, try installing an older version of node:

    The second issue which is addressed in other answers, is the need for a Cakefile in the directory that you are running the cake command in.