How to install webpack-dev-server? Getting unsatisfied dependencies

I used:

npm install -g webpack npm install -g webpack-dev-server 

I keep getting:

 ├── UNMET PEER DEPENDENCY webpack@ >=1.3.0 <3 └─┬ webpack-dev-server@1.16.2 └── UNMET PEER DEPENDENCY webpack@1 || ^2.1.0-beta 

Then I tried:

 npm install webpack@2.1.0-beta.25 -g 

Trying to install npm webpack-dev server still gives the same error. What gives?

+5
source share
2 answers
 npm install --save-dev webpack npm install --save-dev webpack-dev-server 

Try these commands ... it worked for me ...

+8
source

This article may also help:

http://ia.njamieson.co.uk/2017/01/21/a-very-simple-guide-setting-up-webpack-dev-server-on-a-mac-using-terminal/

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

Run your webpack-dev server, assuming your files are in the src folder:

 webpack-dev-server --content-base=src 
0
source

Source: https://habr.com/ru/post/1257872/


All Articles