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

293
Views
webpack-dev-server No se puede encontrar el módulo 'webpack'

Estoy tratando de usar webpack-dev-server para ejecutar un programa simple, pero recibo este error:

 module.js:471 throw err; ^ Error: Cannot find module 'webpack' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)

He instalado webpack con el siguiente comando npm

 npm install --save-dev webpack

y tengo la siguiente configuración:

 (webpack.config.js) var webpack = require('webpack'); var path = require('path'); var BUILD_DIR = path.resolve(__dirname, 'client/public'); var APP_DIR = path.resolve(__dirname, 'client/app'); var config = { entery: APP_DIR + '/index.js', output: { path: BUILD_DIR, filename: 'bundle,js', }, module: { loaders: [ { test: /.jsx?$/, loader: 'babel-loader', exclude: /node_modules/, query: { presets: ['es2015', 'react'] } } ] } }; module.exports = config;

He probado de todo y estoy realmente perdido. ¿Alguien tiene alguna idea?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

npm install --save-dev webpack no es suficiente.

También tienes que instalar lo siguiente:

 npm install --save-dev webpack-dev-server

Y opcionalmente, también puedes instalar:

 npm install --save-dev webpack-dev-middleware webpack-hot-middleware
over 4 years ago · Santiago Trujillo Report

0

Tuve el mismo problema, pero lo resolví instalando webpack-cli adicional

 npm install --save-dev webpack-cli
over 4 years ago · Santiago Trujillo Report

0

Prueba lo siguiente:

En primer lugar, debe instalar webpack-dev-server

npm install --save-dev webpack-dev-server

Luego, en su paquete.json, use esto en su secuencia de comandos de inicio:

"start": "webpack serve --config webpack.config.js --open"

Tenga en cuenta que webpack.config.js debe reemplazarse con el nombre de archivo de su archivo de configuración de paquete web.

Ahora ejecuta npm start

¡Espero que funcione!

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!