-1

When you try to "npm start" your react app for the first time on Windows 10, it will launch on internet explorer / Edge as default. Do you want to ALWAYS launch on a different browser?

You can simply change your default browser like below: (see this for how to do it step by step with images).

  1. Navigate to Settings. You can get there from the Start menu.
  2. Select System.
  3. Click Default apps in the left pane.
  4. Click Microsoft Edge under the "Web browser" heading. ...
  5. Select the new browser (ex: Chrome) in the menu that pops up.

If you want to keep your default browser and "npm start" with another browser, see this thread.

Maieul
  • 1
  • 1
  • 3
  • https://facebook.github.io/create-react-app/docs/advanced-configuration,go through this link it will provide you the detail – Kishan Jaiswal Apr 05 '19 at 12:34
  • Welcome to SO! Thanks for this, but it looks more like an answer to a question, and to more of a general computing problem that anything directly related to programming, so I'm voting to close. In future, you can self-answer questions (if they are on topic) by asking a question and posting an answer. – A Jar of Clay Apr 05 '19 at 12:35

1 Answers1

1

If you are using create-react-app:

You need to set the BROWSER .env variable:

By default, Create React App will open the default system browser, favoring Chrome on macOS. Specify a browser to override this behavior, or set it to none to disable it completely. If you need to customize the way the browser is launched, you can specify a node script instead. Any arguments passed to npm start will also be passed to this script, and the url where your app is served will be the last argument. Your script's file name must have the .js extension.

See: https://facebook.github.io/create-react-app/docs/advanced-configuration

Pang
  • 9,564
  • 146
  • 81
  • 122
Luciano Semerini
  • 656
  • 5
  • 10