1

I have tried many solutions to fix this error, but nothing is working. I've uninstalled sass and node-sass several times, I updated to what I thought was the latest versions of sass and sass-loader to no avail. Am I doing something wrong? My JSON file is below.

{
  "name": "w18-final-project",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^13.5.0",
    "node": "^17.7.2",
    "node-sass": "^7.0.1",
    "react": "^18.1.0",
    "react-dom": "^18.1.0",
    "react-script": "^2.0.5",
    "react-scripts": "^2.1.3",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts --openssl-legacy-provider start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}
David Feudale
  • 167
  • 1
  • 11
  • 1
    You should just downgrade the `node-sass` version because the `react-scripts` dependency won't work with this version of it, or you should just use `sass` instead. – SMAKSS Jun 01 '22 at 19:22

1 Answers1

3

Thanks for the suggestions! The following worked:

  1. npm uninstall node-sass

  2. npm i -D sass

Now it compiles and worked like a charm!

David Feudale
  • 167
  • 1
  • 11
  • Following your recommandation, I get the error "To import Sass files, you first need to install node-sass". I am running Node 16.15.0 LTS. – Albert Anstett Jun 01 '22 at 21:35