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

979
Views
webpack 5 - La solicitud analizada es un módulo

Estoy creando la configuración de webpack5 para una aplicación pequeña y, mientras lo hago, me enfrento al problema mencionado a continuación. Por favor sugiera la forma de resolver

Instantánea del problema

 Module not found: Error: Can't resolve 'faker' in 'C:\Gowtham\micro-frontend-training\products\src' resolve 'faker' in 'C:\Gowtham\micro-frontend-training\products\src' Parsed request is a module using description file: C:\Gowtham\micro-frontend-training\products\package.json (relative path: ./src) Field 'browser' doesn't contain a valid alias configuration resolve as module C:\Gowtham\micro-frontend-training\products\src\node_modules doesn't exist or is not a directory looking for modules in C:\Gowtham\micro-frontend-training\products\node_modules single file module using description file: C:\Gowtham\micro-frontend-training\products\package.json (relative path: ./node_modules/faker) no extension Field 'browser' doesn't contain a valid alias configuration C:\Gowtham\micro-frontend-training\products\node_modules\faker is not a file .js

estructura de carpetas estructura de carpetas

webpack.config.js

 module.exports = { mode: "development", };

paquete.json

 { "name": "products", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "start": "webpack" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "faker": "^6.6.6", "webpack": "^5.67.0", "webpack-cli": "^4.9.2" } }

src/index.js

 import faker from "faker"; let products = ""; for (let i = 0; i < 3; i++) { const name = faker.commerce.productName(); products += `<div>${name}</div>`; } console.log(products);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba con el siguiente package.json ...

 { "name": "products", "version": "1.0.0", "description": "", "main": "dist/main.js", "scripts": { "prestart": "webpack", "start": "node ." }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "faker": "^5.5.3", "webpack": "^5.67.0", "webpack-cli": "^4.9.2" } }

Realice una instalación nueva y ejecute npm start ...

about 4 years ago · Juan Pablo Isaza 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!