- 1 year ago
How to open the browser that you want as default with "npm start" on Windows 10
To open a specific browser as the default browser when running npm start
on Windows 10, you can modify the start script in your package.json
file. Here's how you can do it:
Open your project's
package.json
file in a text editor.Locate the
"scripts"
section, which contains the scripts defined for your project.Find the
"start"
script and modify it to include the browser command. For example, if you want to open Google Chrome, you can use the following command:
json"start": "start chrome http://localhost:3000"
- Save the changes to
package.json
.
Now, when you run npm start
, it will open the specified browser (in this case, Google Chrome) and navigate to http://localhost:3000
or the specified URL.
You can replace "chrome"
with the command for any other browser you want to use as the default. Some common browser commands on Windows are:
- Chrome:
"chrome"
- Firefox:
"firefox"
- Edge:
"msedge"
- Internet Explorer:
"iexplore"
Make sure the browser you want to use is installed on your system and available in the system's PATH environment variable.