Fix NPM Error : Permission denied, mkdir related to node-sass (macOS)

0
73
npm error related to node-sass fix Mac

I was using two development environment. For VueJS with Webpack Simple including Sass and VueJS with full webpack so after working with the previous when I wanted to develop the later project, I started getting an error after I did sudo npm install which was specifically related to node-sass throwing the error that permission denied for creating a new folder.

Error:

gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/Users/ node_modules/node-sass/build’

I spent two hours trying to figure out everything, reinstalling, emptying node cache and everything but to no avail until I understood that this confliction was actually because I was running two versions of nodeJS and one of them one globally installed and found out that sass has a problem adapting to a new version. So, just execute the below command and Voila!.

If the problem persists please post a comment and I will help you out.

Solution:

<code>rm -rf node_modules && npm rebuild node-sass && npm i</code>

Hope this helps.

SHARE
Previous articleGmail Features Comes To Yahoo and Outlook – Gmailify
FroshGeek is run by the team of geeks dedicated to simplify the content for novice users and share some amazing tips, tutorials, news and many more.

LEAVE A REPLY

Please enter your comment!
Please enter your name here