Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku: troubleshooting npm errors during deploy - reading a /tmp file

Some new dependency or some other damn thing is causing npm to error during a get push heroku master deploy:

-----> Node.js app detected
-----> Resolving engine versions
       Using Node.js version: 0.10.1
       Using npm version: 1.2.15
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
       ....
       npm ERR! Additional logging details can be found in:
       npm ERR!     /tmp/build_24pmtv04ok0ss/npm-debug.log
       npm ERR! not ok code 0

not ok indeed. There's no other useful information printed to the console, so of course I want to see what's in that log file.

So I try a little of this:

$ heroku run cat /tmp/build_24pmtv04ok0ss/npm-debug.log

However, no such file appears to exist:

Running `cat /tmp/build_24pmtv04ok0ss/npm-debug.log` attached to terminal... up, run.3166
cat: /tmp/build_24pmtv04ok0ss/npm-debug.log: No such file or directory

My questions are thus:

  • Where did the log file go? Whyfor can't I read it?
  • Is there any other way for Heroku/npm to give me a verbose error printed to the console?
  • Why does the exact same node environment work fine locally, but fail on Heroku?
like image 888
bugeats Avatar asked Mar 21 '13 23:03

bugeats


1 Answers

Before you go through all the trouble of using a custom build pack, try enabling a more verbose logging output on heroku using:

heroku config:set NPM_CONFIG_LOGLEVEL=verbose

See https://devcenter.heroku.com/articles/troubleshooting-node-deploys for more information.

like image 97
Michael Yagudaev Avatar answered Nov 14 '22 08:11

Michael Yagudaev