Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version

Tags:

npm

Can you help me? I got this error when I hit ng s

ERROR in ./src/styles.scss (./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/styles.scss)
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
    at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/app.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
    at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/detail-view/detail-view.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
    at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/footer/footer.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
    at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/products/products.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
    at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/slider/slider.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
    at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/header/header.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
    at Object.sassLoader (E:\Ibtikar\shop\node_modules\sass-loader\lib\loader.js:31:19)

like image 465
FiryCode Avatar asked May 24 '18 00:05

FiryCode


People also ask

Does Sass loader require node Sass?

Getting Started. sass-loader requires you to install either Dart Sass, Node Sass on your own (more documentation can be found below) or Sass Embedded. This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use.

How do I check Sass version?

To check the version, run the command: sass –version. The latest version is 1.49.

Why node Sass is required?

It enables a developer to create code in another language and translate it into CSS , and it compiles SASS to CSS at an incredible speed. It has introduced various new features like: nesting. data variables.


Video Answer


2 Answers

You need to run npm rebuild (or npm rb) in your project folder.

This command runs the npm build command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary.

Source

like image 78
flppv Avatar answered Sep 21 '22 15:09

flppv


This worked for me

npm install --save-dev node-sass
like image 40
giveJob Avatar answered Sep 22 '22 15:09

giveJob