I'm returning to an old fluxible project I started a while back and when I use npm run dev
it seems to be starting twice and is throwing an error. It used to work - what is the configuration that's causing this error? Is the standard fluxible configuration supposed to be running two web servers one on port 3000 and one on 3001?
> node webpack-dev-server.js & PORT=3001 nodemon start.js -e js,jsx
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node start.js`
Webpack Dev Server listening on port 3000
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node start.js`
using redis session
Application listening on port 3001
events.js:141
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3001
I noticed that in the webpack-dev-server.js it is also calling start.js as well.
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
var shell = require('shelljs');
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
//quiet: true,
proxy: {
'*': { target: 'http://localhost:3001' }
}
}).listen(3000, function () {
shell.env.PORT = shell.env.PORT || 3001;
shell.exec('"./node_modules/.bin/nodemon" start.js -e js,jsx', function () {});
console.log('Webpack Dev Server listening on port 3000');
});
maybe that shell.exec call to start.js is redundant?