코딩하는 애옹😸

Error: ENOSPC: System limit for number of file watchers reached 본문

Programming/Issues

Error: ENOSPC: System limit for number of file watchers reached

DevYe 2022. 5. 27. 22:03
728x90

오류 내용 :

VScode에서 react를 실행할 때, 아래와 같은 오류 메세지가 나타났습니다. 

Error: ENOSPC: System limit for number of file watchers reached 
...

 

다른 분들은 아래와 같이 fileWatcher의 limit를 늘려주는 방법으로 해결했지만,

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

 

저는 'sudo sysctl -p' 명령어를 입력했을 때,

sysctl: setting key "fs.inotify.max_user_watches": Read-only file system

Read-only라서 적용이 되지 않았습니다.

 

 

How to solve : 

실험해본 결과, jupyter lab에서는 react가 제대로 작동하는 것을 보고 VScode 상의 문제라는 것을 알게 됐습니다.

먼저, VSCode에서 Settings을 들어갑니다.

  • On Windows/Linux - File > Preferences > Settings
  • On macOS - Code > Preferences > Settings

 

'watcher'을 검색한 후, '**/node_modules/*/**'을 '**/node_modules/**'로 바꿔주면 됩니다.

전 이미 바꿔놨습니다.

 

 

해결!

 

단순 watcher의 개수를 늘려주는 것은 더 많은 폴더가 node_modules에 추가됐을 때 다시 문제를 일으킬 수 있습니다. 따라서 VScode에서 설정을 바꿔주는 것이 앞으로 기능들을 확장하게 될 때 더 도움이 될 것입니다.

Comments