ERROR in Cannot find module 'node-sass'

bier hier picture bier hier · Jan 8, 2018 · Viewed 288.4k times · Source

Config: macOS High Sierra, version 10.13.2, node:v8.1.2 npm:5.0.3 When I run npm start in my angularjs project I get this error:

ERROR in Cannot find module 'node-sass'

After this I run:

npm i node-sass

Now I get this error:

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1

Why won't npm install node-sass? How can I install node-sass?

Answer

Alex Onozor picture Alex Onozor · Sep 30, 2018

Here's the solution:

sudo npm install --save-dev  --unsafe-perm node-sass

Enjoy!