Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.(5)

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

ITtutoria

ITtutoria Logo ITtutoria Logo

ITtutoria Navigation

  • Python
  • Java
  • Reactjs
  • JavaScript
  • R
  • PySpark
  • MYSQL
  • Pandas
  • QA
  • C++
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA
Home/ Questions/Error: node sass version 5.0.0 is incompatible with ^4.0.0 - how to solve it?
Next
Answered
Maureen Wilson
  • 21
Maureen Wilson
Asked: May 17, 20222022-05-17T14:11:15+00:00 2022-05-17T14:11:15+00:00In: javascript

Error: node sass version 5.0.0 is incompatible with ^4.0.0 – how to solve it?

  • 21

. Advertisement .

..3..

. Advertisement .

..4..

I get the error: Node Sass version 5.0.0 is incompatible with ^4.0.0 when I try to run the program below:

import './App.scss'
 
 function App() {
  return (
  <div className="App">
  App
  </div>
  );
 }
 
 export default App;
{
  "name": "react-17-node-sass-5",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
  "@testing-library/jest-dom": "^5.11.5",
  "@testing-library/react": "^11.1.0",
  "@testing-library/user-event": "^12.1.10",
  "node-sass": "^5.0.0",
  "react": "^17.0.1",
  "react-dom": "^17.0.1",
  "react-scripts": "4.0.0",
  "web-vitals": "^0.2.4"
  },
  ...
 
  }
 }

The error appears the system notifies as follows:

Failed to compile.
 
 ./src/App.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--5-oneOf-6-3!./node_modules/s
 ass-loader/dist/cjs.js??ref--5-oneOf-6-4!./src/App.scss)
 Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.

I tried to solve it with another sample. I got the reference in the community forum, but it still returned an invalid result. If someone knows the solution, please give me the support. Thanks!

node sass version 5.0.0
  • 2 2 Answers
  • 45 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

2 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    lyytutoria Expert
    2022-06-07T02:09:39+00:00Added an answer on June 7, 2022 at 2:09 am

    The cause:

    sassloader is the cause of this error. Node-sass @latest is v5.0.0 but sass-loader expects 4.0.0, so there is a semantic-versioning mismatch.

    Another reason is that their repository has an open issue with an associated fix. This needs to be addressed.

    Solution

    Don’t install node.sass 5.0.0 because the major version just got bumped.

    Uninstall node -sass

    npm uninstall node-sass

    Then we have to install the most recent version (previously 5.0).

    npm install [email protected]

    Notice: LibSass and node-sass are no longer required. Therefore, dart-sass is recommended. You may use sass instead. This is a Node.js distribution for dart-sass compiled in pure JavaScript.

    sass-loader  v10.0.5 also can fix it, but you can not use it as a project dependency, you only use it as a dependency of your dependencies. A fixed version, angular-cli locks to node-sass v4,… are used in CRA. If you only installed node-sass, let’s check the above solution. If you are working on a empty project and your Webpack configuration can be managed ( note that not using CRA or a CLI to scaffold your project), let’s set up the newest sass-loader.

    Another solution is moving to sass (dart-sass). Previous version consists of locking node-sass to version 4.x.x, it is 2 years old and lacks of new SCSS features.

    • 19
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Helena Lee
    2022-05-26T04:10:25+00:00Added an answer on May 26, 2022 at 4:10 am

    Your Node.js version may not be compatible with your Node.sass version.

    Also, be sure to check the documentation at node–sass.

    This image will help you decide which Node.js version is compatible with the node.sass version.


    Node%20Sass%20version%205.0.0%20is%20incompatible%20with%20%5E4.0.0

    If you are using Node.js 12 on Windows (“maybe”) then you will need to install node.sass 4.12.

    npm install [email protected]

    Yes, that’s right. Now you just need to install the Node.js version recommended by node.sass with the Node.js version installed.

    • 22
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question
  • How to Split String by space in C++
  • How To Convert A Pandas DataFrame Column To A List
  • How to Replace Multiple Characters in A String in Python?
  • How To Remove Special Characters From String Python

Explore

  • Home
  • Tutorial

Footer

ITtutoria

ITtutoria

This website is user friendly and will facilitate transferring knowledge. It would be useful for a self-initiated learning process.

@ ITTutoria Co Ltd.

Tutorial

  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

Legal Stuff

  • About Us
  • Terms of Use
  • Privacy Policy
  • Contact Us

DMCA.com Protection Status

Help

  • Knowledge Base
  • Support

Follow

© 2022 Ittutoria. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.