Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用内置php和composer时,安装框架 / 安装插件报错 #291

Closed
FishZe opened this issue Feb 11, 2023 · 1 comment · Fixed by #296 or #297
Closed

使用内置php和composer时,安装框架 / 安装插件报错 #291

FishZe opened this issue Feb 11, 2023 · 1 comment · Fixed by #296 or #297
Labels
bug 意外行为或意外问题

Comments

@FishZe
Copy link
Contributor

FishZe commented Feb 11, 2023

受影响版本

3.0.0

描述

使用一键安装脚本安装框架报错:

[!] 检测到目录 zhamao-v3/ 已安装过框架,请更换文件夹名称或删除旧文件夹再试!
root@fishze:/data/Data/Code/QQBot# mkdir test
root@fishze:/data/Data/Code/QQBot# cd test
root@fishze:/data/Data/Code/QQBot/test# bash <(curl -fsSL https://zhamao.xin/v3.sh)
[*] 检查是否存在 PHP ... 不存在,将下载内建 PHP
[*] 使用的内建 PHP 版本: 8.1
[*] 正在下载 https://dl.zhamao.xin/php-bin/down.php?php_ver=8.1&arch=x86_64 ... 完成!
[*] 安装内建 PHP 完成!
[*] 检查是否存在 Composer ... 不存在,将下载内建 Composer
[*] 正在下载 https://mirrors.aliyun.com/composer/composer.phar ... 完成!
[*] 安装内建 Composer 完成!
[*] 正在检查 Git、unzip、7z 能否正常使用 ... 
Composer plugins have been disabled for safety in this non-interactive session. Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.
Do not run Composer as root/super user! See https://getcomposer.org/root for details
[*] 环境检查完成!
[*] 开始安装框架到目录 zhamao-v3 ...
[*] 从 Composer 拉取框架 ...
/dev/fd/63: line 243: composer: command not found
[!] 安装框架失败!

定位到v3.sh的243行, 更换为:

echo '{"minimum-stability":"dev","prefer-stable":true}' > composer.json && $composer_executable require -n zhamao/framework:^3.0 && \

后可正常安装

安装插件报错

命令

./zhamao plugin:install https://github.com/zhamao-robot/go-cqhttp-adapter-plugin.git
正在从 github.com/zhamao-robot/go-cqhttp-adapter-plugin.git 克隆插件仓库
sh: 1: cd: can't cd to /.../zhamao-v3/plugins
无法从指定 Git 地址拉取项目,请检查地址名是否正确

可能由于首次启动时不会自动创建plugins目录导致

手动创建目录后:

Cloning into 'd90fd00b-7fa6-4469-a98a-37d75a974ab6'...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 15 (delta 0), reused 10 (delta 0), pack-reused 0
Unpacking objects: 100% (15/15), 25.70 KiB | 299.00 KiB/s, done.
正在检查元信息完整性
插件存在 composer.json,正在安装 composer 相关依赖(需要系统环境变量中包含 composer 路径)
使用内建 Composer
sh: 1: php: not found
无法安装 Composer 依赖,请检查 Composer 是否可以正常运行

可能由于使用内置php导致找不到php导致

使用内置composer不受影响

runtime/composer require zhamao/go-cqhttp-adapter-plugin

复现步骤

bash <(curl -fsSL https://zhamao.xin/v3.sh)
./zhamao plugin:install https://github.com/zhamao-robot/go-cqhttp-adapter-plugin.git

解决方案

No response

附加信息

No response

@FishZe FishZe added the bug 意外行为或意外问题 label Feb 11, 2023
@sunxyw
Copy link
Member

sunxyw commented Feb 11, 2023

非常感谢你的反馈,我们将会尽快修复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 意外行为或意外问题
Projects
None yet
2 participants