推送到Heroku的错误(node.js)

时间:2012-02-19 17:57:10

标签: node.js heroku express

当我将默认快递应用程序推送到heroku时,我收到以下错误。我已经确保我最近使用heroku-toolbelt等,但它似乎是heroku方面的一个错误?有没有人见过这个?它推动得很好并按预期工作,但我怀疑这可能会在将来引发问题。

Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 404 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)

-----> Heroku receiving push
-----> Node.js app detected

/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:425
  return runInNewContext("(" + JSON.stringify(datum) + ")" + lookupCode);
         ^
TypeError: Cannot read property 'node' of undefined
    at evalmachine.<anonymous>:1:118
    at lookupDatum (/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:425:10)
    at Socket.<anonymous> (/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:628:24)
    at Socket.emit (events.js:61:17)
    at Socket._onReadable (net.js:656:51)
    at IOWatcher.onReadable [as callback] (net.js:177:10)

/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:425
  return runInNewContext("(" + JSON.stringify(datum) + ")" + lookupCode);
         ^
TypeError: Cannot read property 'npm' of undefined
    at evalmachine.<anonymous>:1:118
    at lookupDatum (/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:425:10)
    at Socket.<anonymous> (/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:628:24)
    at Socket.emit (events.js:61:17)
    at Socket._onReadable (net.js:656:51)
    at IOWatcher.onReadable [as callback] (net.js:177:10)
-----> Resolving engine versions
       Using Node.js version: 0.4.7
       Using npm version: 1.0.94
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm

       express@2.5.8 /tmp/build_1m5t2ah1oglfb/node_modules/express
       connect@1.8.5 /tmp/build_1m5t2ah1oglfb/node_modules/express/node_modules/connect
       qs@0.4.2 /tmp/build_1m5t2ah1oglfb/node_modules/express/node_modules/qs
       mime@1.2.4 /tmp/build_1m5t2ah1oglfb/node_modules/express/node_modules/mime
       formidable@1.0.9 /tmp/build_1m5t2ah1oglfb/node_modules/express/node_modules/connect/node_modules/formidable
       mkdirp@0.3.0 /tmp/build_1m5t2ah1oglfb/node_modules/express/node_modules/mkdirp
       jade@0.20.3 /tmp/build_1m5t2ah1oglfb/node_modules/jade
       commander@0.5.2 /tmp/build_1m5t2ah1oglfb/node_modules/jade/node_modules/commander
       mkdirp@0.3.0 /tmp/build_1m5t2ah1oglfb/node_modules/jade/node_modules/mkdirp
       Dependencies installed
-----> Discovering process types
       Procfile declares types -> web
-----> Compiled slug size is 3.1MB
-----> Launching... done, v7

2 个答案:

答案 0 :(得分:1)

这是一个heroku问题,似乎已经消失了。

答案 1 :(得分:0)

我会在这里说出来,并说它与解析你的package.json有关。看看Specifying a version of Node.js/npm。一切都是valid JSON吗?

我的猜测是evalmachine正在评估沙盒环境中的package.json(请参阅vm.runInNewContext),lookupCode是某种方式,首先检查{{} 1}},然后是engines.node。这些都可以访问吗?如果这是事实真相,那么Heroku的开发者就不要期待这个错误,并用一些有用的信息来解释它。他们通常对这些事情很好。