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

225
Vistas
React - Module not found, For packages inside the installed packages, when requirting express

Hello I tried to install the express package in a react project But when I import the package inside the app.js using:

const app = require("express");

I get 30 errors all saying

Module not found Error: Can't resolve 'x'

where x are differnt packages like zlib, querystring, path, crypto, fs, stream ....

This is the app.js code when I run it without the require line it works fine

import logo from './logo.svg';
import './App.css';
const app = require("express");

function App() {
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <p>
          Edit <code>src/App.js</code> and save to reload.
        </p>
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
      </header>
    </div>
  );
}

export default App;

And inside my package.json file in my dependencies I do have: "express": "^4.17.3"

I even tried to create a new blank project for this and I had the same problem

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Your bundler (probably Webpack) cannot bundle packages which depend on Node.js APIs.

Express depends on all sorts of things that need Node.js (such as the ability to listen for incoming HTTP requests and use the C library that zlib uses).

You can't run Express inside a browser.

over 4 years ago · Santiago Trujillo 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