title: reactjs. Error: Node Sass version 7.0.1 is incompatible with ^4.0.0
body: <p>i am trying to use sass in my code but when i import the .scss file i got an error saying:</p>
  <blockquote>
  <p>you need to install node-sass</p>
  </blockquote>
  <p>then i install node-sass and get this error:</p>
  <blockquote>
  <p>Error: Node Sass version 7.0.1 is incompatible with ^4.0.0.</p>
  </blockquote>
  <p>after some research i found that i can use sass instead of node-sass
  i uninstalled the node-sass and installed sass
  then it says the first error:</p>
  <blockquote>
  <p>you need to install node-sass</p>
  </blockquote>
  <p>i tried to uninstall the sass-loader and reinstall too but couldn't without --force and didn't worked
  i saw somewhere i should install node-sass v4.14.1 , but when i wanna install it i get this error:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
  npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
  npm ERR! code 1
  npm ERR! path H:\app\node_modules\node-sass
  npm ERR! command failed
  npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
  npm ERR! Building: C:\Program Files\nodejs\node.exe H:\app\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
  npm ERR! gyp info it worked if it ends with ok
  npm ERR! gyp verb cli [
  npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
  npm ERR! gyp verb cli   'H:\\app\\node_modules\\node-gyp\\bin\\node-gyp.js',
  npm ERR! gyp verb cli   'rebuild',
  npm ERR! gyp verb cli   '--verbose',
  npm ERR! gyp verb cli   '--libsass_ext=',
  npm ERR! gyp verb cli   '--libsass_cflags=',
  npm ERR! gyp verb cli   '--libsass_ldflags=',
  npm ERR! gyp verb cli   '--libsass_library='
  npm ERR! gyp verb cli ]
  npm ERR! gyp info using node-gyp@3.8.0
  npm ERR! gyp info using node@16.15.1 | win32 | x64
  npm ERR! gyp verb command rebuild []
  npm ERR! gyp verb command clean []
  npm ERR! gyp verb clean removing "build" directory
  npm ERR! gyp verb command configure []
  npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
  npm ERR! gyp verb `which` failed Error: not found: python2
  npm ERR! gyp verb `which` failed     at getNotFoundError (H:\app\node_modules\which\which.js:13:12)
  npm ERR! gyp verb `which` failed     at F (H:\app\node_modules\which\which.js:68:19)
  npm ERR! gyp verb `which` failed     at E (H:\app\node_modules\which\which.js:80:29)
  npm ERR! gyp verb `which` failed     at H:\app\node_modules\which\which.js:89:16
  npm ERR! gyp verb `which` failed     at H:\app\node_modules\isexe\index.js:42:5
  npm ERR! gyp verb `which` failed     at H:\app\node_modules\isexe\windows.js:36:5
  npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
  npm ERR! gyp verb `which` failed  python2 Error: not found: python2
  npm ERR! gyp verb `which` failed     at getNotFoundError (H:\app\node_modules\which\which.js:13:12)
  npm ERR! gyp verb `which` failed     at F (H:\app\node_modules\which\which.js:68:19)
  npm ERR! gyp verb `which` failed     at E (H:\app\node_modules\which\which.js:80:29)
  npm ERR! gyp verb `which` failed     at H:\app\node_modules\which\which.js:89:16
  npm ERR! gyp verb `which` failed     at H:\app\node_modules\isexe\index.js:42:5
  npm ERR! gyp verb `which` failed     at H:\app\node_modules\isexe\windows.js:36:5
  npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
  npm ERR! gyp verb `which` failed   code: 'ENOENT'
  npm ERR! gyp verb `which` failed }
  npm ERR! gyp verb check python checking for Python executable "python" in the PATH
  npm ERR! gyp verb `which` succeeded python C:\Users\User\AppData\Local\Programs\Python\Python39\python.EXE
  npm ERR! gyp ERR! configure error
  npm ERR! gyp ERR! stack Error: Command failed: C:\Users\User\AppData\Local\Programs\Python\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
  npm ERR! gyp ERR! stack   File "&lt;string&gt;", line 1
  npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
  npm ERR! gyp ERR! stack                       ^
  npm ERR! gyp ERR! stack SyntaxError: invalid syntax
  npm ERR! gyp ERR! stack
  npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:398:12)
  npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
  npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
  npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:npm ERR! gyp ERR! System Windows_NT 10.0.19044
  npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "H:\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
  npm ERR! gyp ERR! cwd H:\app\node_modules\node-sass
  npm ERR! gyp ERR! node -v v16.15.1
  npm ERR! gyp ERR! node-gyp -v v3.8.0
  npm ERR! gyp ERR! not ok
  npm ERR! Build failed with error code: 1</code></pre>
  </div>
  </div>
  </p>
  <ul>
  <li>nodejs version : 16.15.1</li>
  <li>react version : 18</li>
  <li>NPM Version: 8.12.1</li>
  </ul>
  <p>i'm using create-react-app btw
  i tried node-sass version 6 too , didn't work</p>
  <p>Package.json:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{
    "name": "app",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
      "@faker-js/faker": "^7.1.0",
      "@fortawesome/free-regular-svg-icons": "^6.1.1",
      "@fortawesome/free-solid-svg-icons": "^6.1.1",
      "@fortawesome/react-fontawesome": "^0.1.18",
      "@testing-library/jest-dom": "^5.16.4",
      "@testing-library/react": "^13.1.1",
      "@testing-library/user-event": "^13.5.0",
      "axios": "^0.27.2",
      "bootstrap": "^5.1.3",
      "react": "^18.0.0",
      "react-dom": "^18.0.0",
      "react-router-dom": "^6.3.0",
      "react-scripts": "^2.1.3",
      "web-vitals": "^2.1.4"
    },
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "test": "react-scripts test",
      "eject": "react-scripts eject"
    },
    "eslintConfig": {
      "extends": [
        "react-app",
        "react-app/jest"
      ]
    },
    "browserslist": {
      "production": [
        "&gt;0.2%",
        "not dead",
        "not op_mini all"
      ],
      "development": [
        "last 1 chrome version",
        "last 1 firefox version",
        "last 1 safari version"
      ]
    },
    "devDependencies": {
      "node-sass": "^7.0.1"
    }
  }</code></pre>
  </div>
  </div>
  </p>