The css-loader is missing the required dependency peer Webpack5, causing a resolution error

Recently, I've ventured into the world of JavaScript and I'm looking to incorporate vue-audio-visual into my project. However, I encountered a perplexing error in my node console that seems unrelated. The npm error message reads as follows:

code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="503323237d3c3f3134352210667e667e60">[email protected]</a>
npm ERR! Found: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="611604031100020a21554f55574f51">[email protected]</a>
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^4.0.0 || ^5.0.0" from @soda/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0365716a666d676f7a2e6671716c71702e746661736260682e736f76646a6d43322d3b2d32">[email protected]</a>
npm ERR!   node_modules/@soda/friendly-errors-webpack-plugin
npm ERR!     @soda/friendly-errors-webpack-plugin@"^1.7.1" from @vue/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="76151a1f5b051304001f151336425843584743">[email protected]</a>
npm ERR!     node_modules/@vue/cli-service
npm ERR!       peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="83e0efeaaef3eff6e4eaedaee1e2e1e6efc3b7adb6adb2b6">[email protected]</a>
npm ERR!       node_modules/@vue/cli-plugin-babel
npm ERR!         dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR!       3 more (@vue/cli-plugin-router, @vue/cli-plugin-vuex, the root project)
npm ERR!   webpack@"^4.0.0" from @vue/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="42212e2b6f322e37252b2c6f202320272e02766c776c7377">[email protected]</a>
npm ERR!   node_modules/@vue/cli-plugin-babel
npm ERR!     dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR!   19 more (cache-loader, thread-loader, @vue/cli-service, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^5.0.0" from <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fe9d8d8dd392919f9a9b8cbec8d0c8d0ce">[email protected]</a>
npm ERR! node_modules/css-loader
npm ERR!   peer css-loader@"*" from <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b0c6c5d59ddcdfd1d4d5c2f081859e81809e80">[email protected]</a>
npm ERR!   node_modules/vue-loader
npm ERR!     vue-loader@"^15.9.2" from @vue/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="21424d480c5244535748424461150f140f1014">[email protected]</a>
npm ERR!     node_modules/@vue/cli-service
npm ERR!       peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ef8c8386c29f839a888681c28d8e8d8a83afdbc1dac1deda">[email protected]</a>
npm ERR!       node_modules/@vue/cli-plugin-babel
npm ERR!       3 more (@vue/cli-plugin-router, @vue/cli-plugin-vuex, the root project)
npm ERR!   css-loader@"^6.6.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b2c5d7d0c2d3d1d9f2879c85869c82">[email protected]</a>
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^5.0.0" from <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="781b0b0b551417191c1d0a384e564e5648">[email protected]</a>
npm ERR!   node_modules/css-loader
npm ERR!     peer css-loader@"*" from <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3c4a49591150535d58594e7c0d09120d0c120c">[email protected]</a>
npm ERR!     node_modules/vue-loader
npm ERR!       vue-loader@"^15.9.2" from @vue/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="43202f2a6e302631352a202603776d766d7276">[email protected]</a>
npm ERR!       node_modules/@vue/cli-service
npm ERR!         peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3556595c18455940525c5b18575457505975011b001b0400">[email protected]</a>
npm ERR!         node_modules/@vue/cli-plugin-babel
npm ERR!         3 more (@vue/cli-plugin-router, @vue/cli-plugin-vuex, the root project)
npm ERR!     css-loader@"^6.6.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/julapps/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/julapps/.npm/_logs/2022-10-23T12_42_49_511Z-debug-0.log

In my package.json file, I have the following dependencies listed:

css-loader": "^6.6.0"

And the vue dependencies are as follows:

"devDependencies": {
  "@vue/cli-plugin-babel": "~4.5.0",
  "@vue/cli-plugin-router": "^4.5.15",
  "@vue/cli-service": "~4.5.0",
  "@vue/compiler-sfc": "^3.0.0",
  "webpack": "^4.46.0"
}

If anyone can shed some light on what steps I should take next, I would greatly appreciate it.

Answer №1

Instead of using Vite, are you working with Vue3 and Webpack?
While it's not a common choice, I personally recommend Vite.


The error message regarding the issue is quite clear. Allow me to explain:

In order to install css-loader (or any package that depends on it), Webpack 5 or higher is necessary

If you visit the changelog for this package, you'll see that upgrading to Webpack 5 is essential

The minimum supported webpack version is now 5, so we suggest updating to the latest version for optimal performance

Here are some options for you:

  • Consider using Vite instead
  • Install Webpack 5 using npm
  • Try using yarn/pnpm to receive more detailed error messages

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Filter the array and determine the number of elements in the filtered array

I am looking to filter the contents of two arrays and then count the elements where "isimplemented: 'Yes'" is true: const array1 = [{ProjectName: "IT", Department: "Software"}] const array2 = [{Name: "IT", isimplemented: "Yes"}] The method I at ...

What is the best way to simulate an unexported function in Javascript jest environments?

Testing a module in my vuejs project is what I'm currently focusing on. import { getBaseUrl } from "@/application/api/baseUrl"; export default ( uri: string, requestBody: Record<string, string | number> ): void => { let form ...

Issue with ngTable: Error retrieving data for server-side pagination

I am currently working on setting up a server-side table using ng-table. However, I am encountering some issues with the getData function. It keeps giving me errors such as $defer.resolve is not a function or params is not defined. I noticed that I can ac ...

Exploring Next.js dynamic imports using object destructuring

import { UDFCompatibleDatafeed } from "./datafeeds/udf/src/udf-compatible-datafeed.js"; I'm facing a challenge in converting the above import to a dynamic import in Next.js. My attempt was as follows: const UDFCompatibleDatafeed = dynamic(( ...

Collaborating on validating inputs and modules for both backend and frontend

Sharing input validation is crucial for various reasons: Immediate feedback to users on the frontend regarding the validity of their input Enhanced security measures in the backend, preventing manipulation of data through the API Dependency on frontend J ...

What could be causing the counter to not appear in Vue.js when utilizing getters?

Looking at the code snippet below, you'll notice I have a store.js file where I am doubling my value by 2 using getters. However, when trying to access it in result.vue, this.$store.state.doubleCounter; is returning undefined. In my Vuex setup, I hav ...

Is there a way to protect the privacy of State variables within a Flux Store?

Currently, I've implemented my own version of the Flux pattern in a small scale in order to deepen my understanding of the concept. So far, it's been working well and I've been gaining valuable insights! However, I've encountered a chal ...

Notification from HTML code within Django

In my Django project, I am trying to implement an alert. I am sending data from views.py to singup.html in order to display an alert based on certain conditions. However, initially the alert variable in HTML is not assigned a value. It is only after click ...

Can we find a jQuery AJAX equivalent to the 'finally' block in regular JavaScript?

Is there an equivalent of Java's 'finally' in jQuery AJAX calls? I have this code snippet here. Inside my always, I intentionally throw an exception, but I want it to always proceed to the then() method. call.xmlHttpReq = $.ajax({ ...

Alternatives to using $.getJSON()

When utilizing jQuery within the React/Redux environment, what alternative library is typically used for handling straightforward REST calls instead of $.getJSON or $.postJSON? Is there a widely-used option that functions similarly to node's http mod ...

Accessing elements within a ReactJS map structure using the material-ui Selectable List component is not supported

I'm facing a dilemma. Unfortunately, my proficiency in English writing is not up to par... ※Please bear with me as it might be hard to follow. I'm trying to choose the ListItem component, but for some reason, I can't select the ListIt ...

What is the best way to transfer variables from an ng-template defined in the parent component to a child component or directive?

Is there a way to pass an ng-template and generate all its content to include variables used in interpolation? As I am still new to Angular, besides removing the HTML element, do I need to worry about removing anything else? At the end of this ...

Protecting client-side game logic operations with web application security

I've been developing a web-based game that utilizes the Canvas feature of HTML5. However, I've come to realize that there is a significant vulnerability in my system. The scoring and gameplay statistics are currently being calculated on the clien ...

Adjust the DOM based on the output of the function

I'm currently working on creating a list where only one element can be active at a time. The state is updating correctly, but I'm facing an issue with the isActive function. It only activates initially and doesn't trigger when the state chan ...

What causes Node's crypto module to generate varying outputs for identical strings?

I'm currently attempting to execute the following program: var crypto = require('crypto'); var a = crypto.createHash('md5').update('89Zr-J591').digest('hex'); var name = '89Zr−J591'; var b = crypto. ...

Is there a way to deactivate a button upon clicking and then substitute it with a new button that serves a different purpose in AngularJS?

Is there a way to deactivate a button once clicked and substitute it with another button that performs a different task using AngularJS? Here is the button in question: <button type="submit" class="btn btn-small btn-default" ng-disabled="isteam==0 || ...

Is there a way to incorporate expandable content on a Drupal node page using Javascript?

Is there a Drupal Module available that can display a trimmed version of content on the node page and expand it when clicking on a "Read More" link? Thank you! ...

Having trouble with the sleep function in nodejs?

Hey there! I'm currently working on a Node.js function that sends requests using array.map. However, I'm facing a challenge with making the function wait for 4 minutes when an error occurs before sending the next request. I've attempted to u ...

Activate button through input using Bootstrap

I am struggling to achieve the desired functionality with my "sendit" button. I want it to be enabled as soon as there are any characters entered in the box, but I have tried multiple solutions without success. Part of HTML: <input type="password ...

NextJS allows for custom styling of Tiktok embeds to create a unique and

Currently, I am in the process of constructing a website that integrates Tiktok oEmbed functionality. Thus far, everything is running smoothly, but I have encountered an issue - how can I customize the styling to make the body background transparent? I ha ...