Yunzai-Bot
Yunzai-Bot copied to clipboard
Linux环境搭建
linux服务器环境搭建教程
准备一个服务器,要求不高,1核1g都可以, qq小号,米游社cookie,下面开始教程
这里以腾讯轻量应用服务器CentOS 8.2为例。 选择Node.js镜像 (Node版本至少v14以上)
傻瓜式安装过程
创建好后登录服务器,切换root权限
sudo -i
执行脚本,自动搭建
CentOS 8.2
curl -sL http://mtw.so/5U67tU | bash
Ubuntu 18.04.1 LTS
curl -sL http://mtw.so/5EpvSF | sudo -E bash -
进入项目目录
cd Yunzai-Bot
首次运行,按提示输入完成配置登录
node app
后台运行 or 停止
npm start / npm stop
其他
手动搭建环境(CentOS)
切换root权限
sudo -i
安装nodejs
yum install -y dnf
dnf module install nodejs:16 -y
安装git
yum -y install git
安装并运行redis
yum -y install redis && redis-server --daemonize yes
克隆项目
git clone https://github.com/Le-niao/Yunzai-Bot.git
克隆失败的可以用码云
git clone https://gitee.com/Le-niao/Yunzai-Bot.git
安装模块
cd Yunzai-Bot
安装cnpm
npm install cnpm -g --registry=https://registry.npm.taobao.org
用cnpm安装,主要安装Puppeteer,下载chrome浏览器
cnpm install
安装chrome依赖库
yum install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 -y && yum install libdrm libgbm libxshmfence -y && yum install nss -y && yum update nss -y;
安装中文字体
yum groupinstall fonts -y
运行
node app
后台运行 or 停止
npm start / npm stop
运行成功
这个搭建怎么找到文件修改配置
Error: Could not find expected browser (chrome) locally. Run npm install
to download the correct` Chromium revision (982053).
RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= 0 and <= 4294967295. Received 206_122_285_581
linux 输出的角色卡片是乱码 的怎么解决呀
无法显示中文
无法显示中文
安装中文字体
yum groupinstall fonts -y
建议更新脚本,将安装chrome放到 安装npm依赖前面 现在的版本npm会自动访问谷歌安装chrome 导致国内服务器卡住
有无更新命令?
有无更新命令?
使用机器人命令: #更新 #重启
或命令行: git pull && npm i && npm restart
[2022-06-07T21:49:47.557] [ERROR] [iMac:484436257] - 报错:global.js
Error: ENOENT: no such file or directory, scandir './resources/global_img'
at Object.readdirSync (node:fs:1405:3)
at readdirectory (file:///opt/Yunzai-Bot/lib/app/global.js:71:18)
at init (file:///opt/Yunzai-Bot/lib/app/global.js:64:3)
at file:///opt/Yunzai-Bot/lib/app/global.js:25:1
at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
at async loadApp (file:///opt/Yunzai-Bot/lib/init.js:171:19)
at async init (file:///opt/Yunzai-Bot/lib/init.js:47:3)
at async Client.
关闭登录保护还要验证码,需要怎么发送
这怎么回事
cnpm install时报错
编辑:已解决,不要使用腾讯自带的node.js,直接用CentOS8.2执行一键安装即可
能不能做一个微信版本的机器人,改一下接口代码
sill idealTree buildDeps cnpm安装失败 换过淘宝和npmmirror镜像还是不行 腾讯云上挂不了梯子... 佬佬,救救
您好,我已经收到您的邮件!
您好,我已经收到您的邮件!
能否提供一个低版本2.1.8的克隆链接,现在已经找不到之前的版本了
一键安装这样了,是因为什么
自动搭建脚本的链接失效了wwwwwwwwwwwwwwwwwww
自动脚本能修复一下吗?
这些个报错是啥意思啊,还有输入指令为什么都是角色查询呢
您好,我已经收到您的邮件!
[root@VM-20-14-centos Yunzai-Bot]# npm start
[email protected] start pm2 start ./config/pm2/pm2.json
[PM2] Applying action restartProcessId on app [Yunzai-Bot](ids: [ 1 ]) [PM2][ERROR] Process 1 not found Process 1 not found /root/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/pm2/lib/API.js:1717 acted.push(proc.pm2_env ? proc.pm2_env.pm_id : proc.pm_id) ^
TypeError: Cannot read properties of undefined (reading 'pm2_env')
at /root/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/pm2/lib/API.js:1717:25
at Array.forEach (
可以弄成微信群聊的接口吗
node:internal/modules/cjs/loader:956
const err = new Error(message);
^
Error: Cannot find module '@redis/client/dist/lib/commands/generic-transformers'
Require stack:
- /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/ADD.js
- /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/index.js
- /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/index.js
- /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/ADD.js:9:30)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/ADD.js',
'/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/index.js',
'/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/index.js',
'/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/index.js'
]
}
最后启动机器人(node app)的时候报了这个错误,大家有遇到么?
您好,我已经收到您的邮件!
node:internal/modules/cjs/loader:956 const err = new Error(message); ^ Error: Cannot find module '@redis/client/dist/lib/commands/generic-transformers' Require stack: - /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/ADD.js - /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/index.js - /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/index.js - /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/index.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15) at Function.Module._load (node:internal/modules/cjs/loader:804:27) at Module.require (node:internal/modules/cjs/loader:1028:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/ADD.js:9:30) at Module._compile (node:internal/modules/cjs/loader:1126:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) at Module.load (node:internal/modules/cjs/loader:1004:32) at Function.Module._load (node:internal/modules/cjs/loader:839:12) at Module.require (node:internal/modules/cjs/loader:1028:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/ADD.js', '/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/index.js', '/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/index.js', '/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/index.js' ] }
最后启动机器人(node app)的时候报了这个错误,大家有遇到么?
我也遇到了这个问题 第一次启动
node:internal/modules/cjs/loader:956 const err = new Error(message); ^ Error: Cannot find module '@redis/client/dist/lib/commands/generic-transformers' Require stack: - /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/ADD.js - /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/index.js - /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/index.js - /root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/index.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15) at Function.Module._load (node:internal/modules/cjs/loader:804:27) at Module.require (node:internal/modules/cjs/loader:1028:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/ADD.js:9:30) at Module._compile (node:internal/modules/cjs/loader:1126:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) at Module.load (node:internal/modules/cjs/loader:1004:32) at Function.Module._load (node:internal/modules/cjs/loader:839:12) at Module.require (node:internal/modules/cjs/loader:1028:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/ADD.js', '/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/bloom/index.js', '/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/commands/index.js', '/root/Yunzai-Bot/node_modules/_@[email protected]@@redis/bloom/dist/index.js' ] }
最后启动机器人(node app)的时候报了这个错误,大家有遇到么?
我也遇到了这个问题 第一次启动
我弄好了,应该是安装指定package.json版本的redis
cnpm install [email protected]
或者可以考虑关掉再重启redis服务
十分感谢,我去试一试