[Solved] npm run production error : "unknown option no-progress"

Next JS Tarif Hossain

Problem:

Sometimes when we run the command

npm run dev

            OR

npm run production

getting an error like in the image :



Solution:

You will need to update the scripts section of your "package.json" file accordingly

Before:

"scripts": {
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "npm run development -- --watch",
    "watch-poll": "npm run watch -- --watch-poll",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
}

After:

"scripts": {
    "development": "mix",
    "watch": "mix watch",
    "watch-poll": "mix watch -- --watch-options-poll=1000",
    "hot": "mix watch --hot",
    "production": "mix --production"
}

Also, update "webpack.mix.js"

Before:

mix.js('resources/js/app.js', 'public/js');

After:

mix.js('resources/js/app.js', 'public/js').vue();

That's all! We hope this article might be helpful to npm run production error.To learn more about Next JS you can check

Next. js & React - The Complete Guide (incl. Two Paths!) course