webpack -v endlessly states that one CLI for webpack must be installed

Try npm install webpack-cli -g


Give Try below steps:

npm uninstall webpack --save-dev

Then change & follow the below step again

npm install [email protected] --save-dev

Now check your webpack.config.js & change "loaders" to "rules" in "webpack.config.js". Below is the code which worked for me :-

var path = require('path');

var webpack = require('webpack');

module.exports = 

{

entry: './js/app.js',

 output: {

  path: path.resolve(__dirname, 'build'),

   filename: 'app.bundle.js'

    },

 module: {

    rules: [
            {
                test: /\.js$/,
                loader: 'babel-loader',
                query: {
                    presets: ['es2015', 'react']
                }
            }
        ]
    },
    stats: {
        colors: true
    },
    devtool: 'source-map'
};