Aleksandrenko
Aleksandrenko

Reputation: 3063

node.js installing - can not find express

Im installing express the way it si shown in the express.js guide. http://expressjs.com/guide.html

After running 'node app', i get this error:

   /Users/xxx/Documents/work/node/app.js:3
    var app = express();
              ^
    ReferenceError: express is not defined
        at Object.<anonymous> (/Users/xxx/Documents/work/node/app.js:3:11)
        at Module._compile (module.js:449:26)
        at Object.Module._extensions..js (module.js:467:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Module.runMain (module.js:492:10)
        at process.startup.processNextTick.process._tickCallback (node.js:244:9)
    nma:node xxx$ 

Upvotes: 1

Views: 3578

Answers (1)

ebohlman
ebohlman

Reputation: 15003

You need something like var express=require('express'); in order for express to be defined. The link you cited mentions doing just that; maybe you glossed over a step or two (far easier to do than you might think)?

Upvotes: 8

Related Questions