nodeJS jake文件Hello World程序不能正常工作
我有一个简单的hello world jake文件,它给出了一个错误:
victors-macbook-pro:votefor Victor $ jake -f jakefileasynchronous
(在/用户/胜利者/文件/工作区/ votefor / votefor)文件[第一行的错误] [错误] ReferenceError:找不到variables: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粘贴
你必须像这样执行它
jake -f path_to_file.js asynchronous
一定要全球安装(我得到了npm WARN prefer global jake@0.5.16 should be installed with -g
)
npm install jake -g