Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Unknown option '--output' React & Django

In my package.json file I have:

  "scripts": {
    "dev": "webpack --mode development ./x/frontend/src/index.js --output  ./x/frontend/static/frontend/main.js",
    "build": "webpack --mode production ./x/frontend/src/index.js --output ./x/frontend/static/frontend/main.js"
  },

and when I try to run this command: npm run build it shows me an error: [webpack-cli] Error: Unknown option '--output'

How can I fix this?

like image 374
some nooby questions Avatar asked Oct 24 '25 14:10

some nooby questions


1 Answers

It is nothing to do with Django. It is webpack module.

Apparently you are using old version of webpack.

You have to use --output-path instead of --output.

like image 191
NKSM Avatar answered Oct 26 '25 04:10

NKSM



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!