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重新安装依赖包


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM