0

I've installed globally the express module and is localised in

D:\Programs\nodejs\npm\node_modules\express

Now If I want to use this module I need to write this in my .js file

var express = require("D:\Programs\nodejs\npm\node_modules\express");

What to do to write it this way

var express = require("express");

Because now this works: require("http");, but this: doesn't require("express");

philnash
  • 64,214
  • 10
  • 52
  • 79
Humberd
  • 2,498
  • 2
  • 17
  • 31

1 Answers1

-1

Try to install express using

npm install express.

Then you will able to access it like

require('express');

Above command install express module in your local node_module of app.

RIYAJ KHAN
  • 14,597
  • 5
  • 30
  • 52