Ask Your Question

Revision history [back]

The error "Cannot find module 'fsevents'" is a common issue while using Vite on Windows operating system. This error occurs due to the fact that fsevents is a macOS specific API and is not available on Windows.

To solve this issue, you can try the following solutions:

  1. Install the fsevents package:
npm install fsevents
  1. Install the fs-extra package:
npm install fs-extra

This will install a cross-platform replacement for fsevents, which will work on both macOS and Windows.

  1. Remove fsevents as a dependency: If you are not using fsevents in your project, you can remove it from your dependencies. To do this, you can run the following command:
npm uninstall fsevents
  1. Re-install the dependencies: Try re-installing all the dependencies by deleting the node_modules folder and running the following commands:
npm cache clean --force
npm install

After trying these solutions, you should be able to resolve the "Cannot find module 'fsevents'" error while using Vite on Windows.