javascripthtmlcssnpmnpm-live-server

Changing default browser for npm live-server


I am using npm live-server package to load my website on changes. However my page is getting opened in Edge even though my system default is Chrome. I tried this command which I saw in npm website.

live-server --browser=chrome

But it did not work. How do I make it to host on chrome.


Solution

  • Some Operating Systems apparently use --browser=google-chrome or --browser='Google Chrome' instead of --browser=chrome. Otherwise the issue may be with the Operating System not being able to locate the Chrome Browser. Try reinstalling Google Chrome on the specific user account with Administrator permissions, since this should add it to the PATH with the creation of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe.

    Sources: How to change default browser with VS Code's "open with live server"?, 127.0.0.1 live-server in npm can't open in any browser. what is the problem here?.