title: Application fails to run on Heroku
body: <p>I have NodeJs application with yeoman, grunt, bower installed. I generatedm angularjs app using yeomen. Local version of application runs with no problem by typing <code>grunt serve</code>. Moreover application was successfully deployed to Heroku by <code>grunt deploy</code> <a href="https://gist.github.com/micjamking/9539467" rel="nofollow noreferrer">link</a>. When trying to access application on heroku it shows: </p>
  
  <blockquote>
    <p>Application Error An error occurred in the application and your page
    could not be served. Please try again in a few moments.</p>
    
    <p>If you are the application owner, check your logs for details.</p>
  </blockquote>
  
  <p>In application log (Heroku dashboard > Activity):</p>
  
  <p>Deployed</p>
  
  <p>Build succeeded</p>
  
  <pre><code>-----&gt; Node.js app detected
  
  -----&gt; Reading application state
         package.json...
         build directory...
         cache directory...
         environment variables...
  
         Node engine:         &gt;=0.10.0
         Npm engine:          unspecified
         Start mechanism:     Procfile
         node_modules source: package.json
         node_modules cached: true
  
         NPM_CONFIG_PRODUCTION=true
         NODE_MODULES_CACHE=true
  
  -----&gt; Installing binaries
         Resolving node version &gt;=0.10.0 via semver.io...
         Downloading and installing node 0.10.35...
         Using default npm version: 1.4.28
  
  -----&gt; Building dependencies
         Restoring node modules from cache
         Pruning unused dependencies
         npm WARN package.json nodejsw3@0.0.0 No repository field.
         Installing any new modules
         npm WARN package.json nodejsw3@0.0.0 No repository field.
  
  -----&gt; Checking startup method
         Found Procfile
  
  -----&gt; Finalizing build
         Creating runtime environment
         Exporting binary paths
         Cleaning npm artifacts
         Cleaning previous cache
         Caching results for future builds
  
  -----&gt; Build succeeded!
  
         nodejsw3@0.0.0 /tmp/build_9b26539892553ae79f16e539e2f083e0
         ????????? (empty)
  
         WARNING: Avoid semver ranges starting with '&gt;' in engines.node
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
  
  -----&gt; Discovering process types
         Procfile declares types -&gt; web
  
  -----&gt; Compressing... done, 6.8MB
  -----&gt; Launching... done, v9
         https://myapp.herokuapp.com/ deployed to Heroku
  </code></pre>
  
  <p>Project structure:</p>
  
  <p><img src="https://i.stack.imgur.com/kkIlg.png" alt="enter image description here"></p>
  
  <p><strong>Log</strong></p>
  
  <pre><code>2015-02-07T17:49:56.504866+00:00 heroku[router]: at=error code=H10 desc="App cra
  shed" method=GET path="/" host=myapp.herokuapp.com request_id=257d316d-98
  d1-4d21-a170-7c27e42b907e fwd="10.10.10.11" dyno= connect= service= status=503
   bytes=
  2015-02-07T17:49:57.762152+00:00 heroku[router]: at=error code=H10 desc="App cra
  shed" method=GET path="/favicon.ico" host=myapp.herokuapp.com request_id=
  f109ba40-e921-486a-a79a-7a7d842705a7 fwd="10.10.10.11" dyno= connect= service=
   status=503 bytes=
  2015-02-07T17:53:40.155437+00:00 heroku[router]: at=error code=H10 desc="App cra
  shed" method=GET path="/" host=myapp.herokuapp.com request_id=7e0e784c-0e
  76-48b1-ad3e-bbf74b400e31 fwd="10.10.10.11" dyno= connect= service= status=503
   bytes=
  2015-02-07T17:53:41.454002+00:00 heroku[router]: at=error code=H10 desc="App cra
  shed" method=GET path="/favicon.ico" host=myapp.herokuapp.com request_id=
  4d56eacf-5515-48e4-9b5d-34ccc4c4457e fwd="10.10.10.11" dyno= connect= service=
   status=503 bytes=
  2015-02-07T17:54:20.109125+00:00 heroku[router]: at=error code=H10 desc="App cra
  shed" method=GET path="/" host=myapp.herokuapp.com request_id=b244e431-81
  d6-4f82-a0e0-1e845a45a449 fwd="10.10.10.11" dyno= connect= service= status=503
   bytes=
  2015-02-07T17:54:21.286203+00:00 heroku[router]: at=error code=H10 desc="App cra
  shed" method=GET path="/favicon.ico" host=myapp.herokuapp.com request_id=
  e2c7d762-a88c-49f6-a15b-e1768e7310d5 fwd="10.10.10.11" dyno= connect= service=
   status=503 bytes=
  2015-02-07T17:57:14.924093+00:00 heroku[web.1]: State changed from crashed to st
  arting
  2015-02-07T17:57:16.809601+00:00 heroku[web.1]: Starting process with command `n
  ode index.js`
  2015-02-07T17:57:18.731681+00:00 app[web.1]: module.js:340
  2015-02-07T17:57:18.736235+00:00 app[web.1]:     at Function.Module._resolveFile
  name (module.js:338:15)
  2015-02-07T17:57:18.736237+00:00 app[web.1]:     at Function.Module._load (modul
  e.js:280:25)
  2015-02-07T17:57:18.736241+00:00 app[web.1]:     at require (module.js:380:17)
  2015-02-07T17:57:18.736243+00:00 app[web.1]:     at Object.&lt;anonymous&gt; (/app/ind
  ex.js:1:77)
  2015-02-07T17:57:18.732015+00:00 app[web.1]:     throw err;
  2015-02-07T17:57:18.736244+00:00 app[web.1]:     at Module._compile (module.js:4
  56:26)
  2015-02-07T17:57:18.731200+00:00 app[web.1]:
  2015-02-07T17:57:18.732021+00:00 app[web.1]:           ^
  2015-02-07T17:57:18.736232+00:00 app[web.1]: Error: Cannot find module 'express'
  
  2015-02-07T17:57:18.736239+00:00 app[web.1]:     at Module.require (module.js:36
  4:17)
  2015-02-07T17:57:18.736246+00:00 app[web.1]:     at Object.Module._extensions..j
  s (module.js:474:10)
  2015-02-07T17:57:18.736247+00:00 app[web.1]:     at Module.load (module.js:356:3
  2)
  2015-02-07T17:57:18.736249+00:00 app[web.1]:     at Function.Module._load (modul
  e.js:312:12)
  2015-02-07T17:57:18.736251+00:00 app[web.1]:     at Function.Module.runMain (mod
  ule.js:497:10)
  2015-02-07T17:57:19.580364+00:00 heroku[web.1]: Process exited with status 8
  2015-02-07T17:57:19.592340+00:00 heroku[web.1]: State changed from starting to c
  rashed
  </code></pre>