【问题标题】:'Command not found' when trying to install expo globally ubuntu [duplicate]尝试全局安装 expo ubuntu 时出现“找不到命令”
【发布时间】:2021-11-22 17:09:25
【问题描述】:

当我安装 expo 时,它会安装但不会安装。以下是有关该问题的详细信息。

我首先输入:

yarn global add expo-cli@4

安装时显示:

warning package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "expo-cli > xdl > @expo/dev-server > @expo/metro-config > metro-react-native-babel-transformer@0.59.0" has unmet peer dependency "@babel/core@*".
[4/4] Building fresh packages...

当我使用 yarn 安装 expo 时,我得到:

Installed "expo-cli@4.12.0" with binaries:
      - expo
      - expo-cli
Done in 4.30s. 

但是当我输入 'expo --version' 我得到:

Command 'expo' not found, did you mean:

      command 'exo' from snap exoscale-cli (v1.22.2)
      command 'expn' from deb sendmail-base (8.15.2-18)
      command 'expr' from deb coreutils (8.30-3ubuntu2)
    
    See 'snap info <snapname>' for additional versions.

【问题讨论】:

  • 你尝试重启终端了吗?
  • 是的,我确实尝试过重启终端

标签: linux ubuntu expo yarnpkg


【解决方案1】:

根据您发布的内容,我假设 yarn 安装全局节点模块的文件夹不在您的路径中。

尝试以下方法之一:

  1. 尝试使用 npm 全局安装(可能在您的路径中)

npm i -g expo-cli

  1. 将纱线全局文件夹添加到路径:

echo PATH="$PATH:$(yarn global bin)" &gt;&gt; ~/.bash_profile

有关更多信息,请参阅此主题:Yarn global command not working

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-08
    • 1970-01-01
    • 2016-06-09
    • 1970-01-01
    • 2012-09-22
    • 2019-12-12
    • 1970-01-01
    相关资源
    最近更新 更多