0

I'm on Linux trying to use watchify and keep getting

Error: Cannot find module 'fsevents' from ~/dir

Why is fsevents even being considered by my system? Isn't it strictly a Mac tool? How do I get node to use inotify as its default file monitor instead of fsevents? Specifically, I want watchify to wrap files before and after file changes. Why is this?

I've tried using node-inotify but for some reason I'm still getting

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14

According to this, inotify should just kick in automatically since I'm on Linux.

ddaaggeett
  • 149
  • 2
  • 10

2 Answers2

0

There is no inotify support on the mac (it's a Linux kernel interface), so you cannot do this.

Wez Furlong
  • 4,727
  • 1
  • 29
  • 34
0

instead of using watchify/browserify bundles, consider using webpack --watch as a powerful alternative for modular bundling. if you're using linux, engage inotify with

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

this is straight from the webpack docs under troubleshooting

ddaaggeett
  • 149
  • 2
  • 10