React 项目启动报错:The “path” argument must be of type string

今天下载一个旧的React项目,yarn start 运行,报错:

TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received type undefined

在stackoverflow上找到了解决方法,只需要把package.json 中 react-scripts升级到”^3.4.0″ 即可。

javascript – TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received type undefined raised when starting react app – Stack Overflow

解决方法:

安装 react-scripts 3.4.1( react-scripts – npm 目前版本为3.4.1)

npm install —save react–scripts@3.4.1

或者

  1. 删除node_modules文件夹,删除package-lock.json
  2. 执行npm install 或者 yarn install重新安装依赖包

本质原因是什么,待进一步研究。。。

 

 

 

 

 

 

 

 

码中人 微信公众号

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值