0

I am trying to compile files with webpack and npm for my reactJS applciation. When I am running:

npm install --save react-websocket

Its working fine. Next when I am executing

npm start

getting the following error:

> reactapp@1.0.0 start D:\ReactServer
> webpack-dev-server --hot

'webpack-dev-server' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program     Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! reactapp@1.0.0 start: `webpack-dev-server --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactapp@1.0.0 start script 'webpack-dev-server --  hot'.
npm ERR! This is most likely a problem with the reactapp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server --hot
npm ERR! You can get information on how to open an issue for this project   with:
npm ERR!     npm bugs reactapp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls reactapp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\ReactServer\npm-debug.log

Can anybody help me with this?

  • The error says `webpack-dev-server` is kinda missing. From [webpack dev-tools](https://webpack.github.io/docs/installation.html#dev-tools) Documentation it looks like you need to install it additionally. Did you? – makadev Nov 07 '16 at 13:23

1 Answers1

0

I think you do not have webpack-dev-server installed on your system.

npm install -g webpack-dev-server 

run the above command on cmd/terminal. Hopefully it will resolve your issue.

Rohail Najam
  • 1,031
  • 1
  • 8
  • 11
  • did you ran this command with cmd running as Admin?. try running it in the directory of your project where your package.json resides. run the following command. npm install webpack-dev-server – Rohail Najam Nov 10 '16 at 06:16