无法在这个项目中找到 expo - 你运行过 yarn / npm install 了吗?

Ish*_* IT 0 npm expo

我无法执行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
Run Code Online (Sandbox Code Playgroud)

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```
Run Code Online (Sandbox Code Playgroud)

Glo*_*der 27

如果有人仍然遇到问题,请运行

yarn add expo
Run Code Online (Sandbox Code Playgroud)

如果你的计算机上没有安装yarn,那么运行

npm install -g yarn
Run Code Online (Sandbox Code Playgroud)

然后运行第一个命令。

  • 纱线添加博览会对我有用。如果世博会不见了。 (2认同)

小智 20

我在安装“React Navigation”设置说明中的命令并修复漏洞时也收到了您的消息。使用命令时出现问题:npm audit fix --force。如果您检查此命令后的警告,您会得到

npm WARN Audit 将 expo 更新到 1.0.0,这是 SemVer 的重大更改。

所以,尝试运行:sudo expo update

如果这不起作用,请尝试使用以下命令再次安装 expo,npm install --global expo-cli然后更新。


小智 10

在此处输入图片说明

  1. 将博览会版本从“^1.0.0”更改为“~41.0.1”(package.json)
  2. 安装
  3. 启动


Pul*_*hne 10

  1. 将Expo更新至最新版本sudo expo update 在此输入图像描述

  2. 然后安装更新的npmnpm install 在此输入图像描述

  3. 修复包中的问题npm audit fix --force 在此输入图像描述

  4. 运行应用程序npm startexpo start 在此输入图像描述


off*_*ngh 5

我也面临这个错误。所以我在终端中运行npm命令。

npm install
Run Code Online (Sandbox Code Playgroud)

您不需要更改博览会版本。你只需重新安装它。


小智 1

查看expo版本 - 默认 "^1.0.0" ,更改 ==> "expo": "~41.0.1"