Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!