解决 windows10 BROWSER=none 错误

package.json

....
"scripts": {
    "start": "BROWSER=none react-app-rewired start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
....

其中在window10 环境下, BROWSER=none 会出错
解决办法

npm install cross-env --save-dev

修改packge.json

....
"scripts": {
    "start": "cross-env BROWSER=none react-app-rewired start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
....

cross-env 解决一些跨平台环境变量的问题

你可能感兴趣的:(解决 windows10 BROWSER=none 错误)