npm 安装的浏览器同步不起作用

browser-sync installed by npm is not working

我正在尝试使用 npm 行安装浏览器同步,我得到:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\browser-sync\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

我尝试更新节点(卸载并重新安装)当前版本是 v12.18.2 和 npm 6.14.6

我之前做的唯一奇怪的事情是 运行 这行 npm install -g npm@latest 我没有注意到是 mac.

当我调用版本时 (browser-sync --version) 我得到

YError: Invalid first argument. Expected boolean or string but received function.
    at argumentTypeError (C:\Users\rate9\AppData\Roaming\npm\node_modules\browser-sync\node_modules\yargs\build\lib\argsert.js:64:11)
    at C:\Users\rate9\AppData\Roaming\npm\node_modules\browser-sync\node_modules\yargs\build\lib\argsert.js:45:17
    at Array.forEach (<anonymous>)
    at Object.argsert (C:\Users\rate9\AppData\Roaming\npm\node_modules\browser-sync\node_modules\yargs\build\lib\argsert.js:38:25)
    at Object.version (C:\Users\rate9\AppData\Roaming\npm\node_modules\browser-sync\node_modules\yargs\build\lib\yargs.js:796:19)
    at runFromCli (C:\Users\rate9\AppData\Roaming\npm\node_modules\browser-sync\dist\bin.js:46:10)
    at Object.<anonymous> (C:\Users\rate9\AppData\Roaming\npm\node_modules\browser-sync\dist\bin.js:38:5)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
[Function]

我 运行 windows 10

谢谢!

问题似乎出在最新版本的 browser-sync 上,我回滚到旧版本并且似乎工作正常

npm install -g browser-sync@2.26.7