[Fixed] express is not defined in express


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

I am getting the following error.

> D:\nodejs\mynode\index.js:2  
> var app=express();
ReferenceError: express is not defined
    at Object.<anonymous> (D:\nodejs\mynode\index.js:2:9)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3


should enter your code directory and use “npm install” in your shell!

Leave a Reply

(*) Required, Your email will not be published