To import Sass files, you first need to install node-sass

user210757 picture user210757 · Nov 8, 2019 · Viewed 9.3k times · Source

Running create-react-app, I get the error in my create-react-app application:

To import Sass files, you first need to install node-sass. Run npm install node-sass or yarn add node-sass inside your workspace.

I do have node-sass installed.

package.json:

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

project node_modules folder:

enter image description here

I've uninstalled, reinstalled, updated, cleaned cache, etc. How do I fix?

Answer

Maduekwe Pedro picture Maduekwe Pedro · May 10, 2020

what worked for me was that I uninstalled global node-sass and installed it in my current project directory

npm uninstall -g node-sass

npm install node-sass

make sure to stop npm start until after installation, if possible restart your system when installation is done