Fahid Javid

Fahid Javid


April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories


How to fix ( Error: EACCES: permission denied, mkdir )

Fahid JavidFahid Javid

Nodejs and NPM have made life so easier. If you use Gulp toolkit with it I am sure you love it 😍

However, I came across Error: EACCES: permission denied, mkdir (directory permissions) issue today when I tried to install all gulp packages and their dependencies with the following commands in a project.

$ npm install

I also tried by updating Nodejs, NPM and by installing NPM with sudo to give it current user administrative permissions.

$ sudo npm update
$ sudo npm install

I got the same error every single time. After digging into this issue and reading log file I used the NPM install command with sudo and a couple of permission flags given below.

$ sudo npm install --unsafe-perm=true --allow-root

This command fixed the issue. It worked like a charm and installed all gulp packages without any directory permission errors.

My name is Fahid and I’m a Full-Stack WordPress Developer. I started working with WordPress community and I’m finding myself learning something new every single day.

Comments 13
  • bob
    Posted on

    bob bob

    Reply Author

    you’re a good man!


  • Christopher Ortiz
    Posted on

    Christopher Ortiz Christopher Ortiz

    Reply Author

    Omg finally this actually works. What does the –unsafe-perm=true do that allows it to work? anyone know?


  • Shabbir Ahmad
    Posted on

    Shabbir Ahmad Shabbir Ahmad

    Reply Author

    Have the same issue in my Samsung Galaxy s10a
    Guide me how’s fix
    Permission denied EACCES


  • KG
    Posted on

    KG KG

    Reply Author

    How does running with SUDO on the local directory is an acceptable solution?? Wow!!


  • Alex
    Posted on

    Alex Alex

    Reply Author

    thanks sir I was facing the issue for long time.


  • Daniel
    Posted on

    Daniel Daniel

    Reply Author

    OMG Finally a to the point solution, finally worked on my linux subsystem, THANK YOU


  • Bhavesh
    Posted on

    Bhavesh Bhavesh

    Reply Author

    Thank you so much , this issue was driving me nuts for last 2 hours.


  • Pablo
    Posted on

    Pablo Pablo

    Reply Author

    nice! thx


  • Minh
    Posted on

    Minh Minh

    Reply Author

    Thanks for sharing the fix. I ran into permission issue even while I am running the install command as sudo user. Running with the –unsafe-perm=true –allow-root fixed it.


  • lee
    Posted on

    lee lee

    Reply Author

    thanks alot sir, this solved my problem