Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

132
Vistas
Node http module is not found when using from typescript
$ node -v
v16.13.0

I'm very new to TS/JS and try to understand how to import modules provided by node js with typescript. Following this How to use Node http module in TypeScript QA I tried it myself and wrote the following simple typescript file:

import * as http from "http"

When running tsc main.ts I got the following error:

main.ts:1:23 - error TS2307: Cannot find module 'http' or its 
corresponding type declarations.

Maybe some more options are required to the tsc? I tried to add tsc --module commonjs main.ts but got the same error.

I thought all node js modules are visible for typescript by default.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

this is all you need to do :')

import { http } from "http";
about 4 years ago · Juan Pablo Isaza Denunciar

0

tsc --init

To initialize the Typescript configuration file. The error disappeared for me.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda