Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»Error: EACCES: permission denied, scandir (Resolved)

    Error: EACCES: permission denied, scandir (Resolved)

    By RahulJanuary 27, 20232 Mins Read

    The “Error: EACCES: permission denied, scandir” error can also occur when using NPM (Node Package Manager) and trying to install a package. This is because NPM needs to access certain directories on your system, such as log files under the home directory or the global node_modules directory, and the error occurs when it doesn’t have the proper permissions to do so.

    Advertisement

    The Problem:

    While running the npm command, I faced the following error message.

    NPM error message:
    glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] { errno: -13, code: 'EACCES', syscall: 'scandir', path: '/root/.npm/_logs' }

    Generally, users receive this error, while running the npm commands with the root account. Here, we will discuss two solutions to resolve this error message.

    Solution 1:

    It is recommended not to run the npm command as the root account. This can be harmful to your system. So you can simply switch to a non-root account and run the same command.

    Most probably this will resolve your issue.

    Solution 2:

    If you are bound to run the npm command as the root account. Then make sure the current working directory, in which you are running the npm command is owned by the root account.

    So, change the current working directory (CWD) owner to root.

    chown root:root . 
    

    Then run your npm commands, and it should run without any error.

    Conclusion

    In summary, the “Error: EACCES: permission denied, scandir” error can occur when using NPM if the user does not have the proper permissions to access a specific directory. In this article, we have discussed two solutions to resolve this error on your system.

    error npm Solution
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Implementing a Linux Server Security Audit: Best Practices and Tools

    15 Practical Examples of dd Command in Linux

    Iptables: Common Firewall Rules and Commands

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Python Lambda Functions – A Beginner’s Guide
    • 10 Practical Use Cases for Lambda Functions in Python
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.