Make VS Code open Chrome browser when running 'npm start' React script when inside a Linux WSL2 distro on Windows 11

Viewed 413

I'm developing on a Windows 11 system in an Ubuntu WSL2 environment and I need VS Code to open Chrome instead of my system's default browser (MS Edge), when I run the 'npm start' React script.

I've tried using the cross-env package to help me set the BROWSER env variable in the React script command but it's not working with the following permutations:

"start": "cross-env BROWSER=chrome react-scripts start"
"start": "cross-env BROWSER='chrome' react-scripts start"
"start": "cross-env BROWSER='google chrome' react-scripts start"
"start": "cross-env BROWSER=google-chrome-stable react-scripts start"
"start": "cross-env BROWSER='google-chrome-stable' react-scripts start"

Web developer life should not be this hard

0 Answers
Related