Wednesday, May 2, 2012

Issue running express on Ubuntu 12.04

I had node installed on Ubuntu 11.10 and had express working. I then upgraded to 12.04 and suddenly I get the following stack trace:

throw e; // process.nextTick error, or 'error' event on first tick
ReferenceError: express is not defined
at Object.<anonymous> (/home/cyrus/server.js:2:11)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)

I removed express using npm and then cleared my cache and ran the following:

npm install express;

Still I get the same stack trace indicated express is not defined, although npm ls shows that I have express 2.5.9 installed with connect version 1.8.7.

My node script is as follows:

var app = require('express').createServer();
app.get('/', function(req,res){


It worked I upgraded to Ubuntu 12.04.

No comments:

Post a Comment