【问题标题】:Coffeescript/cake on Windows: Cakefile can't be foundWindows 上的 Coffeescript/cake:找不到 Cakefile
【发布时间】:2012-03-22 04:02:15
【问题描述】:

我有一个 ~\Cakefile,看起来像这样:

task 'say:hello', 'Howdy!', (options) ->
    console.log 'Hello, world!'

但运行cake(解析为C:\Users\bstraub\AppData\Roaming\npm\cake.cmd,因为它是使用npm 安装的)会出现此错误:

Error: Cakefile not found in C:\Users\bstraub

文件存在。我做错了什么?

【问题讨论】:

    标签: windows node.js coffeescript


    【解决方案1】:

    path.existspath.existsSyncbroken for Windows in node 0.6.9。更新到 0.6.13 可以更正此问题,cake 有效。

    【讨论】:

      【解决方案2】:
      1. 检查文件是否真的被称为Cakefile 而不是CakeFile 或其他名称。
      2. 检查~\Cakefile 是否映射到C:\Users\bstraub\Cakefile~ 可能会映射到其他目录,具体取决于您的系统配置 (例如,使用 cygwin、git-bash 或有趣的企业 env var 设置)。
      3. 检查cd ~是否真的把你带到C:\Users\bstraub

      【讨论】:

      • 一切正常。虽然~ 的使用有点误导;无论我的 cwd 是什么,都会发生这种情况。在节点内部,fs.readFileSync('./Cakefile').toString() 按预期工作。
      猜你喜欢
      • 2012-01-13
      • 1970-01-01
      • 1970-01-01
      • 2011-03-11
      • 2013-09-26
      • 2011-06-16
      • 2012-11-01
      • 2012-10-23
      • 1970-01-01
      相关资源
      最近更新 更多