Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 2, 2022 05:44 pm GMT

Solved: Module not found: Error: Can't resolve 'sass-loader'

I have been struggling with this problem a few minutes ago when I was trying to install node-sass and sass-loader in my Vuejs project.
I used this command :

npm i --save-dev node-sass sass-loader
Output:
Could not resolve dependency: npm ERR! dev sass-loader@"*" from the root project npm ERR!
With some sort of:

npm ERR! code ERESOLVEnpm ERR! ERESOLVE could not resolvenpm ERR! npm ERR! While resolving: [email protected] ERR! Found: [email protected] ERR! node_modules/webpacknpm ERR!   peer webpack@"^4.0.0" from @intervolga/[email protected] ERR!   node_modules/@intervolga/optimize-cssnano-pluginnpm ERR!     @intervolga/optimize-cssnano-plugin@"^1.0.5" from @vue/[email protected] ERR!     node_modules/@vue/cli-servicenpm ERR!       peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/[email protected] ERR!       node_modules/@vue/cli-plugin-babelnpm ERR!         dev @vue/cli-plugin-babel@"~4.5.0" from the root projectnpm ERR!       4 more (@vue/cli-plugin-eslint, @vue/cli-plugin-router, ...)npm ERR!   peer webpack@"^4.0.0 || ^5.0.0" from @soda/[email protected] ERR!   node_modules/@soda/friendly-errors-webpack-pluginnpm ERR!     @soda/friendly-errors-webpack-plugin@"^1.7.1" from @vue/[email protected] ERR!     node_modules/@vue/cli-servicenpm ERR!       peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/[email protected] ERR!       node_modules/@vue/cli-plugin-babelnpm ERR!         dev @vue/cli-plugin-babel@"~4.5.0" from the root projectnpm ERR!       4 more (@vue/cli-plugin-eslint, @vue/cli-plugin-router, ...)npm ERR!   19 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)npm ERR!npm ERR! Could not resolve dependency:npm ERR! dev sass-loader@"*" from the root projectnpm ERR!npm ERR! Conflicting peer dependency: [email protected] ERR!   peer webpack@"^5.0.0" from [email protected] ERR!   node_modules/sass-loadernpm ERR!     dev sass-loader@"*" from the root projectnpm ERR!npm ERR! Fix the upstream dependency conflict, or retrynpm ERR! this command with --force, or --legacy-peer-depsnpm ERR! to accept an incorrect (and potentially broken) dependency resolution.npm ERR!npm ERR! See C:\Users\user\AppData\Local
pm-cache\eresolve-report.txt for a full report.

So, I thought this was some dependency conflicts and there is actually a note about this here

This is how I solved the issue:
npm install -D sass-loader@^10 sass


Original Link: https://dev.to/cyebukayire/solved-module-not-found-error-cant-resolve-sass-loader-50l7

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To