Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 5, 2025

This PR addresses the errno: 'ENOSPC' Node.js warning that occurs when development tools exceed the system's file watching limits on Linux systems.

Problem

The ENOSPC (Error No Space) error commonly occurs in Node.js development environments when build tools, file watchers, and development servers try to monitor more files than the system's inotify limits allow. The default fs.inotify.max_user_watches limit is often too low for modern development workflows.

Solution

Added a new system configuration script that:

  • Increases inotify limits: Sets fs.inotify.max_user_watches to 524288 (recommended minimum)
  • Linux-only: Gracefully skips on macOS and other platforms where inotify doesn't apply
  • Persistent configuration: Adds settings to /etc/sysctl.d/99-dotfiles.conf to survive reboots
  • Immediate effect: Applies changes right away for the current session
  • Conservative approach: Only increases limits if they're currently below the recommended threshold

Changes Made

  • script/install.d/01a-system.sh - New system configuration script that runs early in the installation sequence
  • tests/test_system_config.py - Comprehensive tests to verify the configuration works correctly

Usage

The script runs automatically as part of the dotfiles installation, or can be executed individually:

script/install system

Example output on Linux:

Current inotify limit: 8192
Setting inotify limit to: 524288
Added inotify configuration to /etc/sysctl.d/99-dotfiles.conf
New inotify limit: 524288

Fixes #6.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] errno: 'ENOSPC' Fix ENOSPC Node.js error by configuring system inotify limits Jun 5, 2025
Copilot AI requested a review from andrejusk June 5, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

errno: 'ENOSPC'

2 participants