EPERM node filesystem_error ai_generated partial

Error: EPERM: operation not permitted

ID: node/eperm-operation-not-permitted

Also available as: JSON · Markdown
82%Fix Rate
85%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
20 active

Root Cause

File system permission denied. Common on Windows (file locked by antivirus) or Linux (root-owned files).

generic

Workarounds

  1. 90% success Check file ownership and permissions: ls -la or icacls on Windows
    ls -la or icacls on Windows

    Sources: https://nodejs.org/api/fs.html#file-system-permissions

  2. 85% success Close applications that may have the file locked (IDE, other Node processes)
    IDE, other Node processes

    Sources: https://nodejs.org/api/errors.html#common-system-errors

  3. 88% success On npm install errors, delete node_modules and package-lock.json, then retry
    rm -rf node_modules package-lock.json && npm install

    Sources: https://docs.npmjs.com/cli/v10/commands/npm-install

Dead Ends

Common approaches that don't work:

  1. Run as administrator/root 70% fail

    Security risk — fix the permission issue instead

  2. Disable antivirus temporarily 80% fail

    Unreliable and unsafe workaround

Error Chain

Frequently confused with: