question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node Sass version 5.0.0 is incompatible with ^4.0.0.

See original GitHub issue

Description

When adding the gatsby-plugin-sass to new project, I get the error in the terminal Generating development JavaScript bundle failed Node Sass version 5.0.0 is incompatible with ^4.0.0.

I saw this in stack overflow, seems like there was just a change. Hoping this is the issue: Error: Node Sass version 5.0.0 is incompatible with ^4.0.0

( I tested with a few different gatsby starters and the issue persisted regardless of starter also upgraded my node version just incase)

Steps to reproduce

download Gatsby default starter add gatsby-plugin-sass to project

Expected result

gatsby develop runs successfully

Actual result

Generating development JavaScript bundle failed Node Sass version 5.0.0 is incompatible with ^4.0.0.

Environment

System: OS: macOS 10.15.7 CPU: x64 Intel® Core™ i9-8950HK CPU @ 2.90GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 14.15.0 - ~/.nvm/versions/node/v14.15.0/bin/node npm: 6.14.8 - ~/.nvm/versions/node/v14.15.0/bin/npm Browsers: Chrome: 86.0.4240.111 Safari: 14.0 npmPackages: gatsby: ^2.24.91 => 2.24.91 gatsby-plugin-sass: ^2.3.22 => 2.3.22

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

59reactions
kimbaudicommented, Nov 10, 2020

Another workaround is to just use Dart Sass instead of Node Sass. Especially since LibSass and Node Sass are deprecated

install Dart Sass:

npm i -D sass

update your gatsby-config.js :

before:

{
    resolve: `gatsby-plugin-sass`
}

after:

{
    resolve: `gatsby-plugin-sass`,
    options: {
        implementation: require('sass')
    },
}
25reactions
nheviacommented, Nov 1, 2020

Workaround: use node-sass@4.14.1 (Error: Node Sass version 5.0.0 is incompatible with ^4.0.0)

This is sass-loader requiring semver ^4.0.0, but node-sass just updated to 5.0.0 Pending PR https://github.com/webpack-contrib/sass-loader/pull/899

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: 'node-sass' version 5.0.0 is incompatible with ^4.0.0
Go to your node_module folder and open node-sass modules. · In the package.json file inside node-sass, change the version from "5.0.0" to "4.14.1 ......
Read more >
Node Sass version 6.0.0 is incompatible with ^4.0.0 || ^5.0.0.
Im implementing scss into a Create React App & Typescript build. I also tried the same thing but I still get the error....
Read more >
Error node-sass version 5 0 0 is incompatible with 4 0 0
Using the command: npx create-react-app I created a blank react project on npm v7. 0.7 and Node. js v15.
Read more >
How To Fix - "Error: Node Sass version 5.0.0 is incompatible ...
How To Fix – “Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.” ? · Npm; Node. · Remove Node-sass. yarn remove node-sass...
Read more >
Solved — Node Sass version 7.0.0 is incompatible with ^4.0.0
How to fix: If you want to use scss/sass in your react app try to do this: Step 1: First remove node-sass yarn...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found