npm
ENOENT: no such file or directory
ENOENT: No Such File or Directory
A file or directory referenced in the command or script doesn't exist.
Common Causes
- Wrong path in script or config
- File deleted or moved
- Working directory different from expected
- Symlink broken
Fixes
- 1. Verify path exists
ls -la path/to/file
- 2. Use absolute paths in scripts
const path = require('path'); const fullPath = path.join(__dirname, 'file.txt'); - 3. Create missing directory
mkdir -p dist && npm run build
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 AllocatedKeyErrorMaxListenersExceededWarningRecursionErrorDetached HEAD StateEACCES: Permission DeniedValueErrorNo Space Left on DeviceERR_REQUIRE_ESMFileNotFoundError