Webpack-dev-server: Webpack-dev-server :command not found

Created on 9 Jun 2016  路  2Comments  路  Source: webpack/webpack-dev-server

I have done installing webpack-dev-server globally and locally

Here is my package.json file

"devDependencies": {
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.9.0",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1"
**}

screenshot 3

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

module.exports = {
devtool: 'inline-source-map',
entry: [
'webpack-dev-server/client?http://127.0.0.1:8080/',
'webpack/hot/only-dev-server',
'bootstrap-loader',
'./src'
],
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
resolve: {
modulesDirectories: ['node_modules', 'src''.js',] extension: ['', '.js',]
},
module: {
loaders: [
{
test: /.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015']
}
}
],
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
devServer: {
hot: true,
proxy: {
'*': 'http://localhost:3000'
}
}
};

Most helpful comment

When you install modules locally, it is located node_modules/.bin.

$ cd your-folder-that-have-packages.json
$ node_modules/.bin/webpack-dev-server

Or if you add package.json

    "scripts": {
        "start": "webpack-dev-server"
    },
$ npm run start

will invoke webpack-dev-server

All 2 comments

When you install modules locally, it is located node_modules/.bin.

$ cd your-folder-that-have-packages.json
$ node_modules/.bin/webpack-dev-server

Or if you add package.json

    "scripts": {
        "start": "webpack-dev-server"
    },
$ npm run start

will invoke webpack-dev-server

Thank you :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uMaxmaxmaximus picture uMaxmaxmaximus  路  3Comments

wojtekmaj picture wojtekmaj  路  3Comments

eyakcn picture eyakcn  路  3Comments

nikirossi picture nikirossi  路  3Comments

hnqlvs picture hnqlvs  路  3Comments