2013-10-09 20 views
0

我嘗試從http://arcturo.github.io/library/coffeescript/05_compiling.html獲取蛋糕示例以運行。但是,這會導致一個奇怪的錯誤:CoffeeScript和Cake錯誤

events.js:72 
    throw er; // Unhandled 'error' event 
     ^
Error: spawn ENOENT 
    at errnoException (child_process.js:980:11) 
    at Process.ChildProcess._handle.onexit (child_process.js:771:34) 

這是我Cakefile(從剛複製的「小書上的CoffeeScript」)

fs = require 'fs' 

{print} = require 'sys' 
{spawn} = require 'child_process' 

build = (callback) -> 
    coffee = spawn 'coffee', ['-c', '-o', 'lib', 'src'] 
    coffee.stderr.on 'data', (data) -> 
    process.stderr.write data.toString() 
    coffee.stdout.on 'data', (data) -> 
    print data.toString() 
    coffee.on 'exit', (code) -> 
    callback?() if code is 0 

task 'build', 'Build lib/ from src/', -> 
    build() 

我用咖啡和1.6.3節點0.10.20 。

有誰知道我在做什麼錯? 謝謝!

+0

在線路72什麼在events.js?只是出於好奇。 –

+0

我沒有找到在我的系統上使用的來源。如果我將源代碼卸載,我只能在第72行找到註釋;-) – treeno

回答

1

ENOENT通常的意思是「我尋找你告訴我找到的東西,我沒有找到它」。從示例頁面:

For example, create a file called Cakefile, and two directories, lib and src.

你有這兩個呢?

+0

謝謝,這很接近,thx。就我所知,由於產卵只能啓動二進制文件,因此coffee.cmd是缺少的產物。 – treeno

0

在Windows上,產卵不處理'.cmd'或'.bat'沒有文件擴展名。

repalce

coffee = spawn 'coffee', ['-c', '-o', 'lib', 'src'] 

coffee = spwan 'coffee.cmd', ['-c','-o','lib','src']