ERROR in Cannot find module ‘node-sass’

Here’s the solution:

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

Enjoy!

Edited to explain the options (from comments):

–save-dev is used so that your app is able to find the module in local node_modules. –save-dev adds package to devDependencies in package.json. –unsafe–perm is used to run install scripts as root. To avoid sudo, use nvm instead. –unsafe–perm is really not needed as sudo is already mentioned. So the command basically air tights the script to install node-sass at any cost.

Leave a Comment