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 ERR! code E401 npm ERR! 401 Unauthorized - Token has expired
Token has expired - npm authentication failure
npm ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code EAI_NODATA npm ERR! errno EAI_NODATA npm ERR! getaddrinfo EAI_NODATA registry.npmjs.org
How to fix "npm ERR! code EAI_NODATA - getaddrinfo EAI_NODATA"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"