react-native 初始化项目下载依赖失败

cd 到对应的项目目录执行 yarn 报错
➜  elderHealth git:(master)yarn install
Usage Error: The nearest package directory (/Users/xiaoye/practice/jiedan/elderHealth) doesn't seem to be part of the project declared in /Users/xiaoye.

- If /Users/xiaoye isn't intended to be a project, remove any yarn.lock and/or package.json file there.
- If /Users/xiaoye is intended to be a project, it might be that you forgot to list practice/jiedan/elderHealth in its workspace configuration.
- Finally, if /Users/xiaoye is fine and you intend practice/jiedan/elderHealth to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.

报错信息大概是说yarn的文件文件路径不对

Usage Error: The nearest package directory ({path}) doesn’t seem to be
part of the project declared in {path}.

解决方法

通过查找网上的解决方案,然后发现项目目录中没有yarn.lock文件。在对应目录加一个空白yarn.lock 文件 再重新执行yarn 就可以了。
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值