0
    import http from 'http';
    http.createServer((req, res) => {
      res.end('Hello World');
    }).listen(3000, () => console.log('Port is running on 3000'));

I am using @types/node but it shows an error HTTP module does not have default export.

  • Does this answer your question? [error TS1192: Module '" A.module"' has no default export](https://stackoverflow.com/questions/40429927/error-ts1192-module-a-module-has-no-default-export) – SternK Mar 26 '21 at 10:14

1 Answers1

1

You probably need to import the module like this

import * as http from 'http'

omeanwell
  • 951
  • 5
  • 13