webpack is not recognized as a internal or external command,operable program or batch file

yasar  picture yasar · Mar 5, 2016 · Viewed 183.1k times · Source

I am Learning React.js and i am using windows 8 OS.i have navigate to my root folder

1.Created the package.json file by npm init
2. install webpack by npm install -S webpack.now webpack has been downloaded to my modules folder
3. install webpack globally by typing npm install webpack -g
4. i am also having a webpack.config.js in my root folder which contains the source and ouput directory
5. when i type the webpack command i am getting the below error.

webpack is not recognized as a internal or external command,operable program or batch file

Answer

srikanth_k picture srikanth_k · Oct 21, 2016

Better solution to this problem is to install Webpack globally.

This always works and it worked for me. Try below command.

npm install -g webpack