我正在React的一个项目上工作,遇到了一个让我感到困惑的问题。
每当我运行时yarn start,都会出现此错误:
yarn start
TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须为字符串类型。接收类型未定义
我不知道为什么会这样,如果有人经历过,我将不胜感激。
要解决此问题,只需升级 react-scripts 软件包(使用来检查最新版本npm info react-scripts version):
npm info react-scripts version
"react-scripts": "^3.x.x"
"react-scripts": "^3.4.1"
npm install
yarn install
有人报告此问题是由运行引起的npm audit fix(避免它!)。
npm audit fix