React Native Error: ENOSPC: System limit for numbe

2020-05-11 09:58发布

I have setup a new blank react native app.

After installing few node modules I got this error.

enter image description here

I know it's related to no enough space for watchman to watch for all file changes.

I want to know what's the best course of action to take here ?

Should I ignore node_modules folder by adding it to .watchmanconfig ?

8条回答
该账号已被封号
2楼-- · 2020-05-11 10:49

You could try editing

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

cat /proc/sys/fs/inotify/max_user_watches

fs.inotify.max_user_watches=524288
查看更多
祖国的老花朵
3楼-- · 2020-05-11 10:49

The meaning of this error is that the number of files monitored by the system has reached the limit!!

Result: The command executed failed! Or throw a warning (such as executing a react-native start VSCode)

Solution:

Modify the number of system monitoring files

Ubuntu

sudo gedit /etc/sysctl.conf

Add a line at the bottom

fs.inotify.max_user_watches=524288

Then save and exit!

sudo sysctl -p

to check it

Then it is solved!

查看更多
登录 后发表回答