Reputation: 89
I can't run yarn start
in the terminal to start my react project.
I tried this, and many other things that most people recommend, but it does nothing:
yarn remove node-sass
yarn add sass
yarn run v1.22.17
./node_modules/css-loader/index.js!../node_modules/sass-loader/lib/loader.js!./assets/stylesheets/application.scss 39 bytes [built] [code generated] [1 error]
./src/index.jsx 396 bytes [built] [code generated]
ERROR in ./assets/stylesheets/application.scss (./node_modules/css-loader/index.js!../node_modules/sass-loader/lib/loader.js!./assets/stylesheets/application.scss)
Module build failed (from ../node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 7.0.1 is incompatible with ^4.0.0.
at getRenderFuncFromSassImpl (/Users/blaisepop/code/blaisepop/react-giphy/node_modules/sass-loader/lib/loader.js:108:19)
at Object.sassLoader (/Users/blaisep/code/blaisepop/react-giphy/node_modules/sass-loader/lib/loader.js:46:20)
@ ./assets/stylesheets/application.scss 2:14-132 21:1-42:3 22:19-137
@ ./src/index.jsx 3:0-48
webpack 5.72.0 compiled with 1 error in 1583 ms
Upvotes: 4
Views: 4955
Reputation: 15830
node-sass
is deprecated. Instead use sass
.
Use the following command to uninstall node-sass
and install the new version
npm uninstall node-sass
npm install sass
But if you want to keep using node-sass
for some reason,
You can use the following table to install the appropriate version node-sass
for your installed node version which you can check by the command node --version
npm install node-sass@(your version)
Upvotes: 3