Errors clicking on Heroku (node.js)

When I click the default express app for heroku, I get the following error. I ensured that I am aware of heroin instruments, etc., But it seems that this is a mistake on the part of the hero? Has anyone seen this? He pushes everything in order and works as expected, but I suspect that this may cause problems in the future.

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 
+8
heroku express
source share
2 answers

This was a problem for the hero and seems to be gone.

+1
source share

I'm going to go limb here and say that it has something to do with parsing your package.json . Take a look at Specifying the version of Node.js / npm . Is all valid JSON ?

I assume that this evalmachine evaluates your package.json in a sandbox environment (see vm.runInNewContext ) and lookupCode is some way, first, check engines.node , then engines.npm . Are both of them available? If this is true, then shame on Heroku Devs for not expecting this error and not taking it into account with some useful message. They are usually good at such things.

0
source share

All Articles