We encountered an issue when running the command `npm run dev` on our server. Here's a quick overview:
Issue Description:
1. The `npm run dev` command starts normally for a second or two.
2. Then the system begins to output errors: `Error: ENOSPC: System limit for number of file watchers reached, watch`.
3. The command fails to complete successfully.
Steps to Reproduce:
1. In the folder `~/web/dev.jeftinoputovanje.com/jeftput`, run `npm run dev`.
2. After a short period, the error appears, indicating the system limit for file watchers has been reached.
Through investigation, we found that the error is likely related to the default system limit for file watchers. The application requires more watchers than currently available. A potential solution is to increase the number of available file watchers, or to check what else on the server is consuming watchers so you can reduce usage if possible.
For further details, you can refer to the following links:
1. https://laracasts.com/discuss/channels/ ... yId=852603
2. https://stackoverflow.com/questions/557 ... rs-reached
Below are two code blocks demonstrating the output we receive:
**Code block1**:**Code block2**:Solution:
Increase the system limit for file watchers. You can do this by editing the system configuration as follows:
After applying these changes, re-run to see if the issue is resolved. Additionally, consider monitoring overall usage of file watchers on your system and reducing them if possible. This should help prevent reaching the limit again.
Issue Description:
1. The `npm run dev` command starts normally for a second or two.
2. Then the system begins to output errors: `Error: ENOSPC: System limit for number of file watchers reached, watch`.
3. The command fails to complete successfully.
Steps to Reproduce:
1. In the folder `~/web/dev.jeftinoputovanje.com/jeftput`, run `npm run dev`.
2. After a short period, the error appears, indicating the system limit for file watchers has been reached.
Through investigation, we found that the error is likely related to the default system limit for file watchers. The application requires more watchers than currently available. A potential solution is to increase the number of available file watchers, or to check what else on the server is consuming watchers so you can reduce usage if possible.
For further details, you can refer to the following links:
1. https://laracasts.com/discuss/channels/ ... yId=852603
2. https://stackoverflow.com/questions/557 ... rs-reached
Below are two code blocks demonstrating the output we receive:
**Code block1**:
Code:
VITE v4.5.1 ready in 228 ms→ Local: http://localhost:5173/→ Network: use --host to expose→ press h to show helpLARAVEL v10.8.0 plugin v0.7.8→ APP_URL: http://localhost
Code:
(node:2008118) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag "--unhandled-rejections=strict" (see https://[MASKED_PATH] for unhandled rejections mode). (rejection id: 20)(node:2008118) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag "--unhandled-rejections=strict" (see https://[MASKED_PATH] for unhandled rejections mode). (rejection id: 8425)
Increase the system limit for file watchers. You can do this by editing the system configuration as follows:
Code:
# insert the new value into the system configecho fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p# check that the new value was appliedcat /proc/sys/fs/inotify/max_user_watches
Code:
npm run dev
Statistics: Posted by isscbta — Mon Mar 17, 2025 11:29 am