I use parcel.js to set up my project. This command --open 'google chrome' does not work on Windows, only works on MacOS. The error is: Windows cannot find 'google'. Make sure you typed the name correctly, and then try again.
The browser value passed to --open [browser]
is platform-dependent:
chrome
google-chrome
google chrome
Parcel uses the opn
package to start the browser. From the opn
documentation:
Type:
string | string[]
Specify the app to open the
target
with, or an array with the app and app arguments.The app name is platform dependent. Don't hard code it in reusable modules. For example, Chrome is
google chrome
on macOS,google-chrome
on Linux andchrome
on Windows.You may also pass in the app's full path. For example on WSL, this can be
/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe
for the Windows installation of Chrome.