nodeJS jake文件Hello World Program无效

时间:2013-06-09 08:09:09

标签: node.js jake

我有一个简单的hello world jake文件,它会出错:

victors-macbook-pro:votefor Victor $ jake -f jakefile asynchronous

(在/ Users / Victor / Documents / workspace / votefor / votefor) 文件第1行出错[未知] ReferenceError:找不到变量:desc

victors-macbook-pro:votefor Victor $ cat jakefile

desc('This is an asynchronous task.');
task('asynchronous', [], function () {
      setTimeout(function () {
          console.log("Yay, I'm asynchronous!");
          complete();
    }, 1000);
}, true);

我做错了什么吗?

代码已从http://howtonode.org/intro-to-jake

复制并粘贴

1 个答案:

答案 0 :(得分:1)

你必须像这样执行它

jake -f path_to_file.js asynchronous

请务必全局安装(我有npm WARN prefer global jake@0.5.16 should be installed with -g

npm install jake -g