React错误:TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined

问题

  1. 运行一个刚git clone下来并cnpm install后,React应用:yarn start时,
  2. 报错:TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
  3. 只需要把【react-scripts】升级到【"^3.4.0"】即可

解决:

  1. 在【package.json】中,把【"react-scripts": "^3.x.x"】 替换为【"react-scripts": "^3.4.0"】
  2. 删除【node_modules】文件夹
  3. 执行npm install或者 yarn install重新安装依赖包
posted @ 2020-03-16 13:19  晨光曦微  阅读(1178)  评论(0编辑  收藏  举报