Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  10] [ 7]  / answers: 1 / hits: 24931  / 6 Years ago, wed, july 11, 2018, 12:00:00

Having a little trouble with React. Does anyone know how I can install the peer of webpack@^4.x.x?



This is the error I am recieving when I try to run



webpack-dev-server


in cmd. It just returns



[email protected] requires a peer of webpack@^4.x.x but none is installed. You must install peer dependencies yourself.

More From » reactjs

 Answers
19

webpack-dev-server has Webpack as a peer dependency, which means that you are responsible for installing that yourself.



You could install the latest version of Webpack and add it to your devDependencies with the following command:



npm i -D webpack@latest


By writing webpack-dev-server you are also trying to use the globally installed version of that package. You can use the locally installed one instead by adding it to a script in your package.json:



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

[#54003] Sunday, July 8, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alenaautump

Total Points: 87
Total Questions: 109
Total Answers: 109

Location: Libya
Member since Mon, Dec 7, 2020
4 Years ago
alenaautump questions
Fri, Nov 12, 21, 00:00, 3 Years ago
Wed, Feb 17, 21, 00:00, 3 Years ago
Mon, Jan 25, 21, 00:00, 3 Years ago
;