Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.

Dung Do Tien Nov 24 2020 3446

I have a project web with angular 7 after re-install win 10 I get code from git and run ng serve -o, I got an error Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.

ERROR in ./src/scss/style.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/scss/style.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
    at getRenderFuncFromSassImpl (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:108:19)
    at Object.sassLoader (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:46:20)
ERROR in ./src/app/plugins/filemanager/filemanager.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
    at getRenderFuncFromSassImpl (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:108:19)
    at Object.sassLoader (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:46:20)
ERROR in ./src/app/views/articles/article-detail.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
    at getRenderFuncFromSassImpl (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:108:19)
    at Object.sassLoader (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:46:20)
ERROR in ./src/app/views/articles/articles.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
    at getRenderFuncFromSassImpl (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:108:19)
    at Object.sassLoader (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:46:20)
ERROR in ./src/app/views/dealership/dealership.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
    at getRenderFuncFromSassImpl (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:108:19)
    at Object.sassLoader (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:46:20)
ERROR in ./src/app/views/dealership/dealership-detail.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
    at getRenderFuncFromSassImpl (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:108:19)
    at Object.sassLoader (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:46:20)
ERROR in ./src/app/views/dealership/dealership-featured.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
    at getRenderFuncFromSassImpl (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:108:19)
    at Object.sassLoader (D:\DaiViet\Project\Indian\admin_angular\DVG.APA.CMSClient\node_modules\sass-loader\lib\loader.js:46:20)
i 「wdm」: Failed to compile.

This is my environment:

   _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 7.3.6
Node: 15.2.1
OS: win32 x64
Angular: 7.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.6
@angular-devkit/build-angular     0.13.8
@angular-devkit/build-optimizer   0.13.8
@angular-devkit/build-webpack     0.13.8
@angular-devkit/core              7.3.6
@angular-devkit/schematics        7.3.6
@angular/cdk                      7.3.3
@angular/cli                      7.3.6
@angular/material                 7.3.3
@ngtools/webpack                  7.3.8
@schematics/angular               7.3.6
@schematics/update                0.13.6
rxjs                              6.4.0
typescript                        3.2.4
webpack                           4.29.0

Please support me if you have any solutions.

Have 2 answer(s) found.
  • M

    Marry Christ Nov 24 2020

    This error occurs when versions of NodeJS and  Node Sass are not matched.

    you can resolve your issue by doing as below:

    - Step 1: Remove Nodejs from your computer

    - Step 2: Reinstall Nodejs version 14.15.1 from here.

    - Step 3: Uninstall Node sass by run the command npm uninstall node-sass

    - Step 4: Reinstall Node sass version 4.14.1 by run the command npm install node-sass@4.14.1

    After all steps, you can run command ng serve -o to run your application.

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close