1

I'm trying to install browser-sync using npm line and I get:

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"})

I tried updating node (uninstalled and installed it again) current version is v12.18.2 and npm 6.14.6

only weird thing i did before was running this line npm install -g npm@latest which i did not notice was for mac.

when I call for the version (browser-sync --version) i get

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]

I'm running windows 10

thanks!

Soyrbto
  • 33
  • 6
  • Ciao, these are warnings not errors. If you tipe in command prompt `browser-sync -v` what do you see? – Giovanni Esposito Jul 20 '20 at 00:30
  • As stated above it is a warning about an optional dependency not supported by your platform. The NPM ecosystem sadly has lots of these warnings making people start ignoring these warnings and thus missing real problems. – ext Jul 20 '20 at 00:34
  • I updated the post and added what I get when I prompt browser-sync --version I already see that this warnings are a big deal around npm but in my case it seems that it crashes the package as it does not work – Soyrbto Jul 20 '20 at 00:45
  • [This](https://medium.com/@gichuwil/browsersync-on-windows-10-workaround-2173fb1f71a4) post is old but could help. – Giovanni Esposito Jul 20 '20 at 00:51
  • @giovanniEsposito thanks for the quick reply and looking up the article, but it seems that the tree folder has changed as it was no browser-sync in my nodejs installation and there where 3 folders in node modules (browser-sync, browser--sync-client, browser-sync-ui) it looks like that fix is outdated – Soyrbto Jul 20 '20 at 01:05
  • I tried :) Sorry if I haven't been very helpful. – Giovanni Esposito Jul 20 '20 at 01:06
  • Same here https://stackoverflow.com/a/62982935/3483217 – Grigoris Jul 20 '20 at 10:33

1 Answers1

2

The problem seems to reside in the newest version of browser-sync, I rolled back to an older version and seems to be working fine

npm install -g browser-sync@2.26.7

Serg
  • 2,346
  • 3
  • 29
  • 38