如何解决 npm install 在 Windows 上抛出 fsevents 警告?

问题描述

info fsevents@2.3.1: The platform "win32" is incompatible with this module.
info "fsevents@2.3.1" is an optional dependency and Failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "win32" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and Failed compatibility check. Excluding it from installation.

如果我卸载 fsevents 会怎样?即使它不支持我的机器。 我该怎么做?

解决方法

Windows 机器不支持 fsevents。

见:https://www.npmjs.com/package/fsevents

我收到 EBADPLATFORM Unsupported platform for fsevents 错误。

没事,什么都没坏。 fsevents 仅适用于 macos。其他平台略过。如果您想隐藏此警告,请向 NPM bugtracker 报告错误,要求他们默认隐藏 ebadplatform 警告。

/编辑:

解决您的问题:所有有关 fsevents 的功能都将无法运行,但这也不会破坏您的代码,除非它完全依赖于 fsevents。例如,webpack 在没有 fsevents 的情况下仍然可以正常工作,您只需要重新启动它而不是在 npm run dev

时进行热加载