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

Viewed 3904

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?

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.

Related