Webpack when run in terminal it gives an error `Error: Unknown option '--module-bind'`

961 Views Asked by At

I wanted to run Webpack using npm run build but it gives an error in the Terminal as bellow

[webpack-cli] Error: Unknown option '--module-bind'
[webpack-cli] Run 'webpack --help' to see available commands and options

Error Image

enter image description here

package.json

{
  "name": "onboard-game-development",
  "version": "1.0.0",
  "description": "onboard-game-development",
  "main": "app.js",
  "scripts": {
    "start": "npm run build && node app.js",
    "build": "webpack --mode production --module-bind js=babel-loader",
    "webpack-help":"webpack --help",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/tcvduc/onboard-game-development.git"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/tcvduc/onboard-game-development/issues"
  },
  "homepage": "https://github.com/tcvduc/onboard-game-development#readme",
  "dependencies": {
    "express": "^4.18.1",
    "open": "^8.4.0",
    "opn": "^6.0.0",
    "webpack": "^5.72.1",
    "webpack-cli": "^4.9.2"
  }
}

How can I fix this error? Thank you!

0

There are 0 best solutions below