linux - 尝试全局安装 expo ubuntu 时出现“找不到命令”
问题描述
当我安装 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...
当我使用纱线安装博览会时,我得到:
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.
解决方案
根据您发布的内容,我假设 yarn 安装全局节点模块的文件夹不在您的路径中。
尝试其中之一:
- 尝试使用 npm 全局安装(可能在您的路径中)
npm i -g expo-cli
- 将纱线全局文件夹添加到路径:
echo PATH="$PATH:$(yarn global bin)" >> ~/.bash_profile
有关更多信息,请参阅此线程:纱线全局命令不起作用
推荐阅读
- ios - 防止标签栏项目的视图占用先前访问视图的方向
- javascript - 无法将画布导出为图像
- javascript - 检查字母组合是否出现在随机单词序列中并确定它们的确切位置的功能
- node.js - IMAP Node.js 执行两次,两次保存电子邮件并且不会保存来自发射器的电子邮件
- javascript - 在Javascript中获取两个数组对象的差异
- linear-programming - 将逻辑约束转换为 python 纸浆代码
- php - 使用 f_open 的 PHP 管道数据
- python - pynput 不让 tkinter 创建窗口
- python - 在 django views.py 代码中使用数组 - 这是一个好习惯吗?
- reactjs - TypeScript React Babel ReferenceError:找不到变量:regeneratorRuntime