【问题标题】:React native 'unable to find expo in the project反应原生'无法在项目中找到博览会
【发布时间】:2021-06-07 11:52:09
【问题描述】:

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

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

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

【问题讨论】:

    标签: node.js react-native expo npm-install


    【解决方案1】:

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

    yarn
    

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

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

    【讨论】:

    • 你的意思是 'npm install',因为只有 npm 什么都不提供?
    • 是的,我的意思是'npm install'
    • 我试过...,但它给出了几个警告,例如:npm WARN tar ENOENT: no such file or directory, open 'C:\Users\thoma\Downloads\tracloso\node_modules\ .staging\lodash-228827a0\fp\zipAll.js'
    【解决方案2】:

    这是因为您不在项目文件夹中。
    你需要运行这个命令:

    expo start
    

    在项目文件夹中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      • 2019-01-09
      相关资源
      最近更新 更多