Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Can't start foreman cos node.js complains about some obscure module it can't find

Can't start foreman cos node.js complains about some obscure module it can't find

Problem

trying to get a project working on my debian vm but foreman refuses to start. the node.js error message is not very helpful cos it doesn't even tell me what module can't be found.

[email protected]:/media/fancystuff$ foreman start
22:05:33 web.1     | started with pid 2949
22:05:33 web.1     |
22:05:33 web.1     | module.js:337
22:05:33 web.1     |     throw new Error("Cannot find module '" + request + "'");
22:05:33 web.1     |           ^
'2:05:33 web.1     | Error: Cannot find module '/media/fancystuff/web.js
22:05:33 web.1     |     at Function._resolveFilename (module.js:337:11)
22:05:33 web.1     |     at Function._load (module.js:279:25)
22:05:33 web.1     |     at Array.0 (module.js:484:10)
22:05:33 web.1     |     at EventEmitter._tickCallback (node.js:190:38)
22:05:33 web.1     | process terminated
22:05:33 system    | sending SIGTERM to all processes

btw 1: the error message is the same no matter if web.js is there of if it's deleted....which just adds to my confusion.

btw 2: "foreman check" gives me "valid procfile detected (web)"

sigh.

Problem courtesy of: nerdess

Solution

From this line:

'2:05:33 web.1     | Error: Cannot find module '/media/fancystuff/web.js

it looks like there is a non-printing character at the end of the line in your Procfile where you call node web.js since the ' character that was put after module name string ended up at the beginning of the line.

Editing Procfile and making sure that that special character is gone, your problem will probably be solved. I could replicate this on my Debian dev. server by adding web.js before EOL.

Solution courtesy of: hasanyasin

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Can't start foreman cos node.js complains about some obscure module it can't find

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×