This warning appears when npm skips installing fsevents on non-macOS systems. It is safe to ignore—fsevents is a macOS-only file watching library that is not needed on Windows or Linux.
This message is a warning, not an error—your installation completed successfully. fsevents is a native macOS library that provides efficient file system event monitoring. It's marked as an optional dependency by packages like Chokidar (used by webpack, Vite, Jest, and many other tools). When npm detects you're running on Windows, Linux, WSL, or a Docker container, it correctly skips fsevents installation because the library only works on macOS. The packages that depend on fsevents have fallback mechanisms (usually polling-based file watching) that work on all platforms.
This warning is informational only. Your project will work correctly:
- On macOS: fsevents installs and provides native file watching
- On Windows/Linux: fsevents is skipped, tools use polling fallback
No action is required unless you want to suppress the warning.
If the warnings are distracting, skip optional dependencies:
# Skip optional dependencies during install
npm install --omit=optional
# Or set in .npmrc
echo "omit=optional" >> .npmrcNote: This may skip other optional dependencies you actually want.
npm 7+ handles optional dependencies more gracefully:
# Check npm version
npm -v
# Upgrade npm
npm install -g npm@latestNewer npm versions produce less verbose optional dependency warnings.
If you want a fresh installation to clear any cached state:
# Remove existing installation
rm -rf node_modules package-lock.json
# Clear npm cache
npm cache clean --force
# Reinstall
npm installThe warning will still appear, but installation will be clean.
Test that file watching works in your project:
# For webpack projects
npm run dev # or npm start
# For Jest with watch mode
npm test -- --watch
# For Vite projects
npm run devHot reload and file watching should work normally without fsevents.
Performance implications: On macOS, fsevents uses native APIs for efficient file system monitoring. On other platforms, tools typically fall back to polling (checking files periodically) which uses slightly more CPU but is functionally equivalent.
For large projects on Windows/Linux, you may notice slightly higher CPU usage during development due to polling. This is normal and rarely problematic for most projects.
In Docker development environments, consider using volume mount options that improve file watching performance, such as :delegated or :cached flags on macOS Docker Desktop, or using native Linux filesystems for the project directory.
npm error code ENOENT npm error syscall spawn git npm error path git npm error errno -4058 npm error enoent An unknown git error occurred
How to fix "spawn git ENOENT" in npm
npm error code E401 npm error Incorrect or missing password.
How to fix 'E401 Unable to authenticate' errors with npm private registries
npm notice access token expired or revoked. Please try logging in again.
Token has expired - npm authentication failure
npm ERR! code EAI_AGAIN
How to fix "EAI_AGAIN" in npm
npm error code E403 npm error 403 Forbidden - PUT https://registry.npmjs.org/<package>
How to fix 'E403 Forbidden' error in npm