首页 > 解决方案 > 在这个项目中找不到 expo - 你运行 yarn / npm install 了吗?

问题描述

我无法执行expo start命令。

错误信息:

PS C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project> expo start
Starting project at C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project

Unable to find expo in this project - have you run yarn / npm install yet?
    ├─ action (C:\Users\Jacky Goyal\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:34:11)
    ├─ C:\Users\Jacky Goyal\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:135:22
    └─ expo start (C:\Users\Jacky Goyal\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:350:7)
PS C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project> npm install
added 28 packages, removed 46 packages, changed 34 packages, and audited 653 packages in 8s
17 packages are looking for funding
  run `npm fund` for details
7 low severity vulnerabilities
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
PS C:\Users\Jacky Goyal\OneDrive\Desktop\rn1\my-project> npm audit

npm 审计报告

node-fetch  <=2.6.0 || 3.0.0-beta.1 - 3.0.0-beta.8
Denial of Service - https://npmjs.com/advisories/1556
No fix available
node_modules/isomorphic-fetch/node_modules/node-fetch
  isomorphic-fetch  2.0.0 - 2.2.1
  Depends on vulnerable versions of node-fetch
  node_modules/isomorphic-fetch
    fbjs  0.7.0 - 1.0.0
    Depends on vulnerable versions of isomorphic-fetch
    node_modules/fbjs
      metro  0.22.1 - 0.63.0
      Depends on vulnerable versions of fbjs
      Depends on vulnerable versions of metro-config
      node_modules/metro
        @react-native-community/cli  *
        Depends on vulnerable versions of metro
        Depends on vulnerable versions of react-native
        node_modules/@react-native-community/cli
          react-native  <=0.0.0-ffdfbbec0 || 0.22.0-rc - 0.64.0-rc.4
          Depends on vulnerable versions of @react-native-community/cli
          Depends on vulnerable versions of fbjs
          node_modules/react-native
        metro-config  <=0.63.0
        Depends on vulnerable versions of metro
        node_modules/metro-config
7 low severity vulnerabilities\
Some issues need review, and may require choosing
a different dependency```

标签: npmexpo

解决方案


在此处输入图像描述

  1. 将 expo 版本从 "^1.0.0" 更改为 "~41.0.1" (package.json)
  2. npm 安装
  3. npm 开始

推荐阅读