Error deploying NodeJS application on Heroku

I get an error message:

2012-01-28T00:13:51+00:00 heroku[web.1]: Starting process with command `node server.js`
2012-01-28T00:13:51+00:00 app[web.1]: 
2012-01-28T00:13:51+00:00 app[web.1]: node.js:134
2012-01-28T00:13:51+00:00 app[web.1]:         throw e; // process.nextTick error, or 'error' event on first tick
2012-01-28T00:13:51+00:00 app[web.1]:         ^
2012-01-28T00:13:51+00:00 app[web.1]:     at Array.<anonymous> (module.js:423:10)
2012-01-28T00:13:51+00:00 app[web.1]: Error: Cannot find module '/app/server.js'
2012-01-28T00:13:51+00:00 app[web.1]:     at Function._resolveFilename (module.js:320:11)
2012-01-28T00:13:51+00:00 app[web.1]:     at Function._load (module.js:266:25)
2012-01-28T00:13:51+00:00 app[web.1]:     at EventEmitter._tickCallback (node.js:126:26)

My Node application server is in server.js in the root, I have no idea how to fix this. I made it from cloud9ide and it works great, I deployed the hero from there.

+5
source share
1 answer

It seems like something is trying to require ("server") somewhere in your application, which is optional. The error comes from the .js module, which deals with the requirement of node modules. If you could provide your Procfile and possibly some source code, it would be easier to relate the problem, but at first glance it looks like a relative path pointing to /app/server.js somewhere in your server code, which shouldn't do that.

0

All Articles