Closed semihraifgurel closed 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.
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^
"devDependencies": { "node-sass": "^6.0.0", "sass-loader": "^12.0.0" }
- Add dev dependencies
- Delete package-lock.json or yarn.lock
- Delete node modules
- Run npm install or yarn install
Thanks. It worked for me
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.
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
I resolved it already. I installed an earlier and compatible Version of node and node-sass on my machine and It worked
What worked for me:
I'd recommend to try different sass-loader versions...: https://www.npmjs.com/package/sass-loader?activeTab=versions
@AlbertoPaulPopescu Of all the options in this thread this one seems to work perfectly well. Thank you.
What worked for me:
- delete node modules and package-lock.json and then npm install : didn't work
- 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
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
node-sass worked for me with node v14.17.3 and node-sass 4.14.1.
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.
following chain solved the problem:
npm sass-loader npm update
then restart my project using: npm start
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.
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
andsass-loader
as suggested by others.
This worked for migrated react-scripts
to 4.0.3
yarn add --exact react-scripts@4.0.3
yarn add --exact react-scripts@4.0.3
worked for me. Node v16
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
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.
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!
Jhonmer-araujo ! Muchas gracias ! It worked like a charm!
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
Igual se puede hace funcionar sin instalar directamente node-sass, con la version de next para sass "@zeit/next-sass": "^1.0.1".
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!
Illegal in 2021 to have this issue
The easy solution I found in this video: https://www.youtube.com/watch?v=7uLl4XvFlFs
The easy solution I found in this video: https://www.youtube.com/watch?v=7uLl4XvFlFs
- npm uninstall node-sass
- npm install sass
@MarcAnt this solution worked for me. Thanks!
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 😆
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.
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"
@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!
yarn add --exact react-scripts@4.0.3
worked for me. Node v16
This solved my issue. Super!
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
delete yarn.lock
remove node_modules
yarn add node-sass@latest sass-loader@latest
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
功能
功能
完美解决了我遇到的问题 感谢感谢
to fix it I had to remove
node_modules
andyarn.lock
(not sure if it is ok for everyone) then I add to mypackage.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 requiressass-loader@^10.0.5
and after above actions I havesass-loader@10.2.0
installed in mynode_modules
which is allow to usenode-sass@6.0.0
because inpeerDependecies
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!
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".
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
yard add sass --dev
or
npm i sass --dev
it worked for me.
Thats the correct answer.
node-sass
is deprecated, you have to switch to sass
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
The easy solution I found in this video: https://www.youtube.com/watch?v=7uLl4XvFlFs
- npm uninstall node-sass
- npm install sass
This work for me!! Thanks.
Upgrade you sass loader and it should work smooth as butter!.
npm i sass-loader@latest
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 :)
It helps me !!!
"node-sass": "^6.0.0", "ssas-loader": "^10",
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",
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'.
我在此视频中找到的简单解决方案: https ://www.youtube.com/watch?v=7uLl4XvFlFs
- npm 卸载 node-sass
- npm 安装 sass
有用的
The easy solution I found in this video: https://www.youtube.com/watch?v=7uLl4XvFlFs
- npm uninstall node-sass
- npm install sass
worked for me
Update react-scripts
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
yarn remove node-sass && yarn add sass
I'm using sass
instead.
npm -v
): 7.12.0node -v
): 16.0.1node -p process.versions
): { node: '16.1.0', v8: '9.0.257.24-node.11', uv: '1.41.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.17.1', modules: '93', nghttp2: '1.42.0', napi: '8', llhttp: '6.0.1', openssl: '1.1.1k+quic', cldr: '39.0', icu: '69.1', tz: '2021a', unicode: '13.0', ngtcp2: '0.1.0-DEV', nghttp3: '0.1.0-DEV' }node -p process.platform
): darwinnode -p process.arch
): x64node -p "require('node-sass').info"
): node-sass 6.0.0 (Wrapper) [JavaScript] libsass 3.5.5 (Sass Compiler) [C/C++]npm ls node-sass
): theme-landing@0.1.0 /Users/semihraifgurel/GitHub.noindex/theme-landing ├── node-sass@6.0.0 └─┬ react-scripts@4.0.3 └─┬ sass-loader@10.1.1 └── node-sass@6.0.0 deduped invalidnpm 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 %