sass / node-sass

:rainbow: Node.js bindings to libsass
https://npmjs.org/package/node-sass
MIT License
8.5k stars 1.33k forks source link

Node Sass version 6.0.0 is incompatible with ^4.0.0 || ^5.0.0. #3103

Closed semihraifgurel closed 3 years ago

semihraifgurel commented 3 years ago

npm ERR! code ELSPROBLEMS npm ERR! invalid: node-sass@6.0.0 /Users/semihraifgurel/GitHub.noindex/theme-landing/node_modules/node-sass

npm ERR! A complete log of this run can be found in: npm ERR! /Users/semihraifgurel/.npm/_logs/2021-05-10T07_38_04_899Z-debug.log semihraifgurel@Semih-MacBook-Pro theme-landing %

tomcatmwi commented 3 years ago

None of the solutions proposed here worked for my React project. For anyone struggling with the same thing, here's the solution: update react-scripts to the latest version, as described here: https://create-react-app.dev/docs/updating-to-new-releases/

After that you can install node-sass and sass-loader as suggested by others.

abdullahkhan-z commented 3 years ago

with npm => 1.npm uninstall node-sass 2.npm install node-sass@4.14.1 with yarn => 1.yarn remove node-sass 2.yarn remove node-sass@4.14.1

  • yarn add node-sass@4.14.1

How is that working for node 16^

ecstoic47 commented 3 years ago
"devDependencies": {
    "node-sass": "^6.0.0",
    "sass-loader": "^12.0.0"
 }
  1. Add dev dependencies
  2. Delete package-lock.json or yarn.lock
  3. Delete node modules
  4. Run npm install or yarn install

Thanks. It worked for me

PandaDev2021 commented 3 years ago

For anyone looking for how to fix: Delete package-lock.json Delete node_modules in the terminal run npm install or yarn install

I tried this as well and still got the same error. 😢

Make sure if your have multiple directories, your in the exact directory, running npm i in a parent directory will not install the children directories dependancies, unless something third party like "concurrently" is installed as well.

Stanisds12 commented 3 years ago

Couldn`t install node-sass 4.14, instead found that node-sass is deprecated so I move to dart-sass

run

yarn remove node-sass yarn add sass npm uninstall node-sass npm install sass

This solution worked for me

tech-doctor commented 3 years ago

I resolved it already. I installed an earlier and compatible Version of node and node-sass on my machine and It worked

Alberto-Alive commented 3 years ago

What worked for me:

  1. delete node modules and package-lock.json and then npm install : didn't work
  2. install sass-loader ver 10.2.0 (https://www.npmjs.com/package/sass-loader/v/10.2.0): worked

I'd recommend to try different sass-loader versions...: https://www.npmjs.com/package/sass-loader?activeTab=versions

dominickudiabor commented 3 years ago

@AlbertoPaulPopescu Of all the options in this thread this one seems to work perfectly well. Thank you.

Pookacz commented 3 years ago

What worked for me:

  1. delete node modules and package-lock.json and then npm install : didn't work
  2. install sass-loader ver 10.2.0 (https://www.npmjs.com/package/sass-loader/v/10.2.0): worked

I'd recommend to try different sass-loader versions...: https://www.npmjs.com/package/sass-loader?activeTab=versions

i'm shocked but this worked for me

BobSarfo commented 3 years ago

node-sass page on npmjs.com, I saw the supported node-sass version was 4.14+. npm install node-sass@4.14.1 fixed the issue.

This is what people should be looking out for.... Check you node node with CMD: node -v or node --version and install the appropriate node-sass version

dachoy commented 3 years ago

node-sass worked for me with node v14.17.3 and node-sass 4.14.1.

McTango-AR commented 3 years ago

In package.json

    "devDependencies": {
      "node-sass": "^6.0.1",
      "sass-loader": "^12.1.0"
    }

Delete node_modules Delete package-lock.json Make sure you are running Node v14: nvm -ls

npm install install all packages once more

This worked for me, but using Node v16.6.0.

HappyKid2020 commented 3 years ago

following chain solved the problem:

npm sass-loader npm update

then restart my project using: npm start

LeeMingDe commented 3 years ago

following chain solved the problem:

npm sass-loader npm update

then restart my project using: npm start

Thanks! This worked for me, using node v16.1.0.

asher-gh commented 3 years ago

None of the solutions proposed here worked for my React project. For anyone struggling with the same thing, here's the solution: update react-scripts to the latest version, as described here: https://create-react-app.dev/docs/updating-to-new-releases/

After that you can install node-sass and sass-loader as suggested by others.

This worked for migrated react-scripts to 4.0.3

yarn add --exact react-scripts@4.0.3
tomaszczechowski commented 3 years ago

yarn add --exact react-scripts@4.0.3 worked for me. Node v16

gurayyarar commented 3 years ago

Update version is here "devDependencies": { "sass-loader": "^12.1.0", "node-sass": "^6.0.1" }

When i tried first i came same error. After that i delete yarn.lock file and node_modules folder and then run yarn install now it's working

flefundes commented 3 years ago

Update version is here "devDependencies": { "sass-loader": "^12.1.0", "node-sass": "^6.0.1" }

When i tried first i came same error. After that i delete yarn.lock file and node_modules folder and then run yarn install now it's working

I did the exact same thing as you and it did work.

jhonmer-araujo commented 3 years ago

Couldn`t install node-sass 4.14, instead found that node-sass is deprecated so I move to dart-sass

run

yarn remove node-sass yarn add sass npm uninstall node-sass npm install sass

That works for me too. Thanks!

JavascriptDeNoobAPro commented 3 years ago

Jhonmer-araujo ! Muchas gracias ! It worked like a charm!

Leonardoih commented 3 years ago

No se pudo instalar node-sass 4.14, en su lugar encontré que node-sass está en desuso, así que me muevo a dart-sass correr yarn remove node-sass yarn add sass npm uninstall node-sass npm install sass

funciona para mi

funciona para mi

dachoy commented 3 years ago

Igual se puede hace funcionar sin instalar directamente node-sass, con la version de next para sass "@zeit/next-sass": "^1.0.1".

amrography commented 3 years ago

In package json I updated the versions like follow

- "node-sass": "^4.0",
+ "node-sass": "^6.0",
- "sass-loader": "^7.1.0",
+ "sass-loader": "^12.0",

then ran npm i

and it's working!

aspiiire commented 3 years ago

Illegal in 2021 to have this issue

MarcAnt commented 3 years ago

The easy solution I found in this video: https://www.youtube.com/watch?v=7uLl4XvFlFs

  1. npm uninstall node-sass
  2. npm install sass
chamin96 commented 2 years ago

The easy solution I found in this video: https://www.youtube.com/watch?v=7uLl4XvFlFs

  1. npm uninstall node-sass
  2. npm install sass

@MarcAnt this solution worked for me. Thanks!

limjoohyun2030 commented 2 years ago

I installed the last version of sass-loader by npm install sass-loader@latest and reloaded the page and that solved the problem to me

Thank you thank you 😆

David-Del1 commented 2 years ago

Adding sass-loader as as dev-dependency solved this for me. "devDependencies": { "node-sass": "^6.0.0", "sass-loader": "^11.1.1" }

@tanapaydin is right, but I also had to erase the node_modules folder and the lock file to work.

This definitely worked for me as well.

dsvgit commented 2 years ago

to fix it I had to remove node_modules and yarn.lock (not sure if it is ok for everyone) then I add to my package.json node-sass dependency

"devDependencies": {
  "node-sass": "^6.0.0"
}

and run yarn install

not sure what exactly helped me that's really weird behaviour

I'm using react-scripts@4.0.3 and it requires sass-loader@^10.0.5 and after above actions I have sass-loader@10.2.0 installed in my node_modules which is allow to use node-sass@6.0.0 because in peerDependecies of this version I see "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0"

CarlosRangel17 commented 2 years ago

@dsvgit Thank you for your latest post!! I tried updating to the latest node-sass version ^6.0.1 with sass-loader ^11.1.1; however, I kept seeing this error reported in the thread. I went ahead and tried your exact versions node-sass: ^6.0.0 and sass-loader: 10.2.0 and it worked perfectly!

PotLid commented 2 years ago

yarn add --exact react-scripts@4.0.3 worked for me. Node v16

This solved my issue. Super!

abhijitk7 commented 2 years ago

I was getting below error

node sass version 6.0.0 is incompatible with 4.0.0

performed below steps and it worked for me

with npm => 1.npm uninstall node-sass 2.npm install node-sass@4.14.1

wangmeijian commented 2 years ago

delete yarn.lock remove node_modules yarn add node-sass@latest sass-loader@latest

GreatDseven commented 2 years ago

No se pudo instalar node-sass 4.14, en su lugar encontré que node-sass está en desuso, así que me muevo a dart-sass correr yarn remove node-sass yarn add sass npm uninstall node-sass npm install sass

功能

功能

完美解决了我遇到的问题 感谢感谢

hatamsoyunov commented 2 years ago

to fix it I had to remove node_modules and yarn.lock (not sure if it is ok for everyone) then I add to my package.json node-sass dependency

"devDependencies": {
  "node-sass": "^6.0.0"
}

not sure what exactly helped me that's really weird behaviour

I'm using react-scripts@4.0.3 and it requires sass-loader@^10.0.5 and after above actions I have sass-loader@10.2.0 installed in my node_modules which is allow to use node-sass@6.0.0 because in peerDependecies of this version I see "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0"

For CRA it was enough to update react-scripts 🤯 Thank you so much!

alejandro-fdez commented 2 years ago

For anyone looking for how to fix: Delete package-lock.json Delete node_modules in the terminal run npm install or yarn install

This worked for me. Note that if you use yarn, the lock file is called "yarn.lock".

parsadoc commented 2 years ago

node-sass is a deprecated lib remove it then use [dart-sass](https://www.npmjs.com/package/dart-sass) (it's renamed to [sass](https://www.npmjs.com/package/dart-sass))

yarn remove node-sass or npm uninstall node-sass

then

yard add sass --dev or npm i sass --dev

it worked for me.

aramyesildeniz commented 2 years ago

Thats the correct answer. node-sass is deprecated, you have to switch to sass

mateusloubach commented 2 years ago
npm uninstall node-sass;

npm install node-sass@4.14.1

solution above was found here: https://stackoverflow.com/questions/62304283/src-index-scss-node-modules-css-loader-dist-cjs-jsref-6-oneof-5-1-node

answer provided by: carmen romero

omarrendon commented 2 years ago

The easy solution I found in this video: https://www.youtube.com/watch?v=7uLl4XvFlFs

  1. npm uninstall node-sass
  2. npm install sass

This work for me!! Thanks.

suliman-nm98 commented 2 years ago

Upgrade you sass loader and it should work smooth as butter!.

npm i sass-loader@latest

ivanoffbg commented 2 years ago

When I tried to compile my project with "yarn hot or yarn watch" I had the same error. I fixed it like this:

yarn remove sass-loader yarn remove node-sass _and after that I delete "nodemodules" directory + package.lock file.. then: yarn add sass-loader@^7.0.1 node-sass --dev

after that, you can run your project without problem :)

dembit commented 2 years ago

It helps me !!!

"node-sass": "^6.0.0", "ssas-loader": "^10",

scurrilus commented 2 years ago

I had the same Issue. My solution was. Switch from node-sass to sass. After that it was not working. So i have also updated my old "react-scripts": "^3.4.1" to "react-scripts": "^5.0.0". And then magic, it works. I use this with node 16.8.

"sass": "^1.49.0", "sass-loader": "^10",

Zhangyao719 commented 2 years ago

Try this one. This combination solves my problem. My node version: v16.15.0 "devDependencies": { "node-sass": "^6.0.0", "sass-loader": "^10.2.0", } Version 11 of sass-loader is too new for webpack4 to cause other problems: 'this.getOptions is not a function'.

mr-chk commented 2 years ago

我在此视频中找到的简单解决方案: https ://www.youtube.com/watch?v=7uLl4XvFlFs

  1. npm 卸载 node-sass
  2. npm 安装 sass

有用的

godwintrav commented 2 years ago

The easy solution I found in this video: https://www.youtube.com/watch?v=7uLl4XvFlFs

  1. npm uninstall node-sass
  2. npm install sass

worked for me

cmiltone commented 1 year ago

Update react-scripts

mohamedmehdigara commented 1 year ago

Hello. 1) npm uninstall node-sass 2) npm install node-sass 3) Change react-scripts version in package.json to 4.0.3 4) npm install 5) npm start

sato-thuyetnguyen commented 8 months ago

yarn remove node-sass && yarn add sass I'm using sass instead.