Failing with Cannot find module 'connect/utils'

244 views
Skip to first unread message

CarbonMan

unread,
Jul 23, 2010, 8:29:08 AM7/23/10
to Express
I am new to Linux, Git, node.js and Express but here we go...
I can run node, and now trying to run Express. My program looks like
this:

var app = require('/node/express/lib/express').createServer();

app.get('/', function(req, res){
res.send('hello world');
});

app.listen(3000);

It is failing with :
module:243
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module 'connect/utils'
at loadModule (module:243:13)
at require (module:374:12)
at Object.<anonymous> (/node/express/lib/express/view.js:13:12)
at Module._compile (module:423:23)
at Module._loadScriptSync (module:433:8)
at Module.loadSync (module:306:10)
at loadModule (module:251:12)
at require (module:374:12)
at Object.<anonymous> (/node/express/lib/express/server.js:14:12)
at Module._compile

Any help would be appreciated.

Kadir Pekel

unread,
Jul 23, 2010, 8:34:19 AM7/23/10
to expre...@googlegroups.com
Hi CarbonMan,

if the path is relative, try putting '.' (dot) in the beginning of the path.

Something like

var app = require('./node/express/lib/express').createServer();

Hope this helps.




--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.




--
Kadir Pekel

vision media [ Tj Holowaychuk ]

unread,
Jul 23, 2010, 10:17:10 AM7/23/10
to expre...@googlegroups.com
You need "connect" installed as well. As mentioned on the site
there are several ways to do so, however I suggest:

    $ curl -# http://expressjs.com/install.sh | sh
Tj Holowaychuk
Vision Media
President & Creative Lead
Reply all
Reply to author
Forward
0 new messages