create-react-app: How do I “npm start” with a specific browser?

后端 未结 11 1957
一个人的身影
一个人的身影 2021-01-31 07:11

npm start

starts the react server on the default browser, which is Firefox for me. I like Firefox for browsing but prefer Chrome in web deve

11条回答
  •  梦毁少年i
    2021-01-31 07:52

    There is one package called set-default-browser https://www.npmjs.com/package/set-default-browser

    just download package from there and add following code

    var setDefaultBrowser = require('set-default-browser');
    
    setDefaultBrowser("chrome");
    

    Or you can just run this set-default-browser chrome

    Thanks!

提交回复
热议问题