npm
EACCES: permission denied
EACCES: Permission Denied
The process doesn't have permission to access a file or directory.
Common Causes
- Installing globally without sudo
- node_modules owned by root
- Wrong ownership of project directory
- Antivirus blocking access
Fixes
- 1. Fix ownership
sudo chown -R $USER:$USER .
- 2. Use nvm to avoid global installs
nvm install 20 nvm use 20
- 3. Use npm config prefix
mkdir ~/.npm-global npm config set prefix '~/.npm-global'
Still not fixed?
- • Search the exact error message on Stack Overflow or GitHub Issues
- • Check the official docs for the language or tool
- • Ensure your versions (Node, Python, npm, Docker) are up to date
- • Try in a minimal reproduction (new project, single file)
Related Errors
DuskTools That Might Help
All Errors
JavaScript Heap Out of MemoryModuleNotFoundErrorAddress Already in UseIndentationErrorCannot Find ModulePeer Dependency WarningCORS Policy BlockedTypeError: 'NoneType' Not SubscriptableMerge ConflictDocker Port Already AllocatedENOENT: No Such File or DirectoryKeyErrorMaxListenersExceededWarningRecursionErrorDetached HEAD StateValueErrorNo Space Left on DeviceERR_REQUIRE_ESMFileNotFoundError