我有一个简单的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);
我做错了什么吗?
复制并粘贴答案 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