After such a request in the terminal PhpStorm:

webpack ./src/index.js ./public/bundle.js 

A webpack is not an internal or external command, executable program, or batch file.

Although npm working fine.

  • Did you install webpack via npm install webpack? If so, use node_modules / .bin / webpack .src / index.js ./public/bundle.js or add webpack to $ PATH - UserX
  • 2
    in fact, I simply should have installed it globally -g - Alexander Alekseev

1 answer 1

I had the same error. On the forums it is advised to install packages globally or to set the path manually. Something that looks like crutches.

Using the npm install command, you can simply reconnect all dependency packages to package.json . It helped me, and everything works as it should.

In order for packages to be written as dependencies in package.json , they must also be installed with the --save or --save-dev flag.