用webstorm开发angular项目的时候,改写文件后发现热更新有时候会失效,从而不得不重新运行下项目,然而这浪费了好多时间,google一番后,解决办法如下

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

经此命令敲入终端运行,最好重启下ide.

技术详情:

在linux中默认使用inotify来监视目录文件的变化.如果需要监视的目录文件过大,超过linux的默认值,监视就会失效.比如Ubuntu 10.04 LTS Lucid Lynx 的inotify限制为8192.

查看当前系统inotify的限制大小:

cat /proc/sys/fs/inotify/max_user_watches

 

相关文章:

  • 2021-05-28
  • 2022-12-23
  • 2021-11-11
  • 2021-05-25
  • 2021-07-07
  • 2021-06-09
  • 2021-07-29
  • 2021-11-23
猜你喜欢
  • 2021-11-09
  • 2021-08-26
  • 2022-12-23
  • 2021-09-12
  • 2021-11-22
  • 2021-06-13
  • 2021-10-16
相关资源
相似解决方案