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

644
Vistas
Error: Cannot find module 'browserslist' when I run the npm run build

I'm using latest version of react-scripts npm package i.e. 4.0.3 in my react project and it has a vulnerabilities with one of his dependency package called browserslist, I was trying to resolve this vulnerability by adding this package under the resolutions section in my package.json file. I tried to override the package version with the help of preinstall command npx npm-force-resolutions and it will install the version we specified under the resolutions. My package.json file will be

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "react-scripts start",
    "preinstall": "npx npm-force-resolutions",
    "build": "react-scripts build"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "react-scripts": "^4.0.3"
  },
  "resolutions": {
    "browserslist": "4.16.6"
  }
}

  1. When I run the npm install the preinstall script will run and it will installing the browserslist package version after that I tried to check the list available vulnerabilities with npm audit command and I got 0 vulnerabilities. Refer https://i.stack.imgur.com/cp1Sf.png to install command view. Refer https://i.stack.imgur.com/8dLJz.png to audit command view

  2. After that I tried to run the npm run build command and it will took build script from my package.json file. The build is failing with following error. Refer https://i.stack.imgur.com/Lt3OE.png to build command view

I did lot of research on this from past 2 weeks but no luck at all. I'm definitely missing something after this. It would be great if anyone can help me on this it will be really appreciate.

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

0

Run this in your terminal:

npm i browserslist
over 4 years ago · Santiago Trujillo Denunciar

0

Delete your nodemodules folder and package.lock.json file and run npm install.

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