0

I have a webpack.config.js file like this:

var path = require('path')
var webpack = require('webpack');

module.exports = {
    entry: "./index.js",
    output: {
        path: path.join(__dirname, 'static'),
        filename:'bundle.js'
    },
    module: {
        loaders: [
            { test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"},
            { test: /\.json$/, loader: 'json-loader' },
        ]
    }
};

and my package.json is like:

"scripts": {
    "test": "mocha --compilers js:babel-register --recursive tests/*.js",
    "test:watch": "npm test -- --watch",
    "build": "webpack --progress --profile --colors",
    "build:watch": "webpack --progress --profile --colors --watch",
    "start": "webpack-dev-server"

but when I run npm run start it gives me error saying..

events.js:141
      throw er; // Unhandled 'error' event

What is the issue here ??

1 Answer 1

1

It could be a "port" issue when launching webpack dev server. try webpack-dev-server --port 3000

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.