0

I get a web pack related error when I try to run "npm run dev" as follows 'webpack-dev-server' is not recognized as an internal or external command, operable program or batch file.

I've attached the screenshot of the error from the terminal. As well as a screenshot of the generated log.

enter image description here

Log

enter image description here

user2721794
  • 401
  • 1
  • 4
  • 20
  • Does this answer your question? ['webpack-dev-server' is not recognized as an internal or external command,](https://stackoverflow.com/questions/51849282/webpack-dev-server-is-not-recognized-as-an-internal-or-external-command) – Michael Freidgeim Nov 08 '22 at 05:32

1 Answers1

0

Could you please check the package.json file whether it is installed or not.

If you find webpack-dev-server present under the development dependencies but still its not working try doing an npm install to reinstall the missing packages.

If not you could simply do

npm install webpack-dev-server --save-dev

executing this would save the package under node modules directory.

you could also configure webpack dev server to a custom command under scripts in package.json

"scripts": {
   "start:dev": "webpack-dev-server"
}