React Native'无法在项目中找到expo

Tho*_*amp 2 node.js react-native npm-install expo

我正在与小组成员一起研究 React Native 项目。我制作该项目的小组成员在运行该项目时没有任何问题。我已经全局安装了expo,但无法运行该程序:

\n
Unable to find expo in this project - have you run yarn / npm install yet?\n        \xe2\x94\x9c\xe2\x94\x80 action C:\\Users\\thoma\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\src\\commands\\start.ts:34:11\n        \xe2\x94\x9c\xe2\x94\x80 C:\\Users\\thoma\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\src\\commands\\start.ts:135:22\n        \xe2\x94\x94\xe2\x94\x80 expo start C:\\Users\\thoma\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\src\\exp.ts:350:7\n    npm ERR! code ELIFECYCLE\n    npm ERR! errno 1\n    npm ERR! @ start: `expo start`\n    npm ERR! Exit status 1\n    npm ERR!\n    npm ERR! Failed at the @ start script.\n    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n    npm WARN Local package.json exists, but node_modules missing, did you mean to install?\n    \n    npm ERR! A complete log of this run can be found in:\n    npm ERR!     C:\\Users\\thoma\\AppData\\Roaming\\npm-cache\\_logs\\2021-06-07T11_27_47_082Z-debug.log\n
Run Code Online (Sandbox Code Playgroud)\n

我能做什么来解决这个问题?

\n

Meh*_*oob 5

在项目的根目录下,运行命令

yarn
Run Code Online (Sandbox Code Playgroud)

所以基本上你的合作伙伴会添加一些依赖项并提交他的代码。现在,在获取之后,您需要在项目中拥有这些依赖项,这就是您必须运行上述命令的原因。

您还可以使用npm install,具体取决于您的系统配置。