问题
I've made an app with react native - create-react-native-app. Initially npm start worked fine. But now npm start get's stuck at Starting Packager.
A few days ago, deleting the node_modules folder and reinstalling npm dependencies and then doing npm start seemed to work. But now even that doesn't work.
Any help will be appreciated
npm -v 6.0.0 node -v v10.0.0 react-native-cli: 2.0.1 react-native: 0.54.0 os - Ubuntu 16.04
回答1:
The issue was in the
/proc/sys/fs/inotify/max_user_watches = 8192
/proc/sys/fs/inotify/max_queued_events = 16384
Basically, max_user_watches impacts how many dirs you can watch across all watched roots and max_queued_events impacts how likely it is that your system will experience a notification overflow. So while building the native app, these limits used to exceed because of which build process got stuck.
Just increasing these limits makes it work.
To increase the limit use:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
来源:https://stackoverflow.com/questions/50530220/react-native-npm-start-gets-stuck-at-starting-packager