当我尝试将Meteor应用程序部署到Heroku时,它会在启动时崩溃。
Exception from task: Error: function expects no more than -1 arguments at /app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:26:10 at readUtf8FileSync (packages/boilerplate-generator/boilerplate-generator.js:7) at packages/boilerplate-generator/boilerplate-generator.js:82 at Array.forEach (native) at Function._.each._.forEach (packages/underscore/underscore.js:105) at Boilerplate._generateBoilerplateFromManifestAndSource (packages/boilerplate-generator/boilerplate-generator.js:64) at new Boilerplate (packages/boilerplate-generator/boilerplate-generator.js:17) at generateBoilerplateInstance (packages/webapp/webapp_server.js:288) at packages/webapp/webapp_server.js:556 at Function._.each._.forEach (packages/underscore/underscore.js:113) throw err; ^ Error: function expects no more than -1 arguments at Object.Future.wait (/app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:326:15) at _.extend.runTask (packages/meteor/fiber_helpers.js:79) at Object.WebAppInternals.generateBoilerplate (packages/webapp/webapp_server.js:553) at Object.main (packages/webapp/webapp_server.js:773) at /app/.meteor/heroku_build/app/programs/server/boot.js:194:27 - - - - - at /app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:26:10 at readUtf8FileSync (packages/boilerplate-generator/boilerplate-generator.js:7) at packages/boilerplate-generator/boilerplate-generator.js:82 at Array.forEach (native) at Function._.each._.forEach (packages/underscore/underscore.js:105) at Boilerplate._generateBoilerplateFromManifestAndSource (packages/boilerplate-generator/boilerplate-generator.js:64) at new Boilerplate (packages/boilerplate-generator/boilerplate-generator.js:17) at generateBoilerplateInstance (packages/webapp/webapp_server.js:288) at packages/webapp/webapp_server.js:556 at Function._.each._.forEach (packages/underscore/underscore.js:113)
似乎Npm.require('fs').readFile.length
未定义。
我正在使用this buildpack。当我在本地构建应用程序并使用node main.js
进行测试时,它可以正常工作。我需要对Meteor 0.9.2.1的buildpack进行任何其他更改吗?
答案 0 :(得分:0)
我弄清楚问题是什么,它不是由buildpack或Heroku引起的。
我正在使用包装fs.readFile
的Nodetime,然后使用apply调用原始版本。这就是Npm.require('fs').readFile.length
为0的原因(并没有像我想象的那样未定义)。