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
  • 70,667
  • 10
  • 60
  • 88
Humberd
  • 2,794
  • 3
  • 20
  • 37

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
  • 15,032
  • 5
  • 31
  • 53