面临启动服务器的问题

问题描述

我正在从在线资源中学习 React,并且每天都推送和拉取代码。今天,当我尝试运行项目 yarn start 时,我遇到了这个问题

yarn run v1.22.5
error Couldn't find a package.json file in "/home/aniket/Desktop/react_applications/practice_react_app"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

当我用谷歌搜索时,我得到的答案很少,例如运行 yarn clean cache 此外,我尝试删除该项目并获取该项目的新克隆,但它仍然显示相同的错误

我的 github 仓库网址:https://github.com/aniketstiwari/practice_react_app

解决方法

我通过在项目中添加 node_modules 然后运行命令 yarn 得到了解决方案。

,

路径 package.json 上没有 home/aniket/Desktop/react_applications/practice_react_app 文件

试试

cd practice-react

然后

yarn start