I just installed node by cloning the git repo + make && make install. I then installed npm, and used npm to install express (seems like it fetches Connect automatically since it's a dependency). However, when trying to start a simple express example I get the error message:
Error: Cannot find module 'connect/utils'
at Function._resolveFilename (module.js:219:11)
at Function._load (module.js:171:25)
at require (module.js:246:19)
at Object.<anonymous> (/home/yngve/local/node/lib/node/.npm/express/1.0.3/package/lib/express/response.js:16:13)
at Module._compile (module.js:302:26)
at Object..js (module.js:308:10)
at Module.load (module.js:234:31)
at Function._load (module.js:201:10)
at require (module.js:246:19)
at Object.<anonymous> (/home/yngve/local/node/lib/node/.npm/express/1.0.3/package/lib/express/index.js:52:1)
It seems someone has the same problem here: http://groups.google.com/group/express-js/browse_thread/thread/287086bd30f79cf1/adbb5c669872e45a but the conclusion seems to be that one needs connect installed (which I have). I've checked that I have the following files at least:
/home/yngve/local/node/lib/node/.npm/connect/0.5.8/package/lib/connect/utils.js /home/yngve/local/node/lib/node/.npm/express/1.0.3/node_modules/connect/connect/utils.js
Anyone have a clue?
Resolved
Added
require.paths.unshift('<path_to_node>/lib/node/connect');
But the newest rev. is fixed, so this shouldn't really be necessary (see answer below).
It seems like it was a bug in express. Installing the latest version, 1.0.5, fixed this problem for me.