当我尝试将Meteor应用程序部署到Heroku时,它在启动时崩溃。

任务异常:错误:函数期望的参数不超过-1
    在/app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:26:10
    在readUtf8FileSync处(packages / boilerplate-generator / boilerplate-generator.js:7)
    在package / boilerplate-generator / boilerplate-generator.js:82
    在Array.forEach(本机)
    在Function ._。each ._。forEach(packages / underscore / underscore.js:105)
    在Boilerplate._generateBoilerplateFromManifestAndSource(包/boilerplate-generator/boilerplate-generator.js:64)
    在新的Boilerplate上(packages / boilerplate-generator / boilerplate-generator.js:17)
    在generateBoilerplateInstance(packages / webapp / webapp_server.js:288)
    在packages / webapp / webapp_server.js:556
    在Function ._。each ._。forEach(packages / underscore / underscore.js:113)
    丢错
          ^
错误:函数期望的参数不超过-1
    在Object.Future.wait(/app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:326:15)
    在_.extend.runTask上(packages / meteor / fiber_helpers.js:79)
    在Object.WebAppInternals.generateBoilerplate(packages / webapp / webapp_server.js:553)
    在Object.main(packages / webapp / webapp_server.js:773)
    在/app/.meteor/heroku_build/app/programs/server/boot.js:194:27
    -----
    在/app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:26:10
    在readUtf8FileSync处(packages / boilerplate-generator / boilerplate-generator.js:7)
    在package / boilerplate-generator / boilerplate-generator.js:82
    在Array.forEach(本机)
    在Function ._。each ._。forEach(packages / underscore / underscore.js:105)
    在Boilerplate._generateBoilerplateFromManifestAndSource(包/boilerplate-generator/boilerplate-generator.js:64)
    在新的Boilerplate上(packages / boilerplate-generator / boilerplate-generator.js:17)
    在generateBoilerplateInstance(packages / webapp / webapp_server.js:288)
    在packages / webapp / webapp_server.js:556
    在Function ._。each ._。forEach(packages / underscore / underscore.js:113)

看来Npm.require('fs').readFile.length是未定义的。

我正在使用this buildpack。当我在本地构建应用程序并使用node main.js进行测试时,它可以工作。我需要对Meteor 0.9.2.1的buildpack进行其他更改吗?

最佳答案

我发现了问题所在,这不是由buildpack或Heroku引起的。

我正在使用包装fs.readFile的Nodetime,然后使用apply调用原始时间。这就是Npm.require('fs').readFile.length为0的原因(并非像我想的那样不确定)。

08-19 16:15