Introduction#
It's been a long time since I updated my blog. Recently, I've been at home due to a fracture and I have nothing to do~~ I'm too lazy to move~~, so let's update the blog with some random stuff, hahaha.
Environment Setup#
These are the environment requirements provided by the Miao-Yunzai repository.
Environment Setup: Windows or Linux, Node.js (at least version v16 or above), Redis
But, let's take a look at the Redis documentation. Its Windows installation tutorial is actually completed under WSL. So, it's not recommended to tinker with Windows, let's play with a Linux machine instead.
I'm using a 2c2g Alibaba Cloud, and all the following steps will be demonstrated using the Ubuntu 20.04 system.
I assume that the installation is done on a mainland server, so the following installation steps will try to use a mainland mirror source~~ (I hope nobody really wants to log in to QQ on an overseas machine)~~
Dependency Installation#
Log in to the server using SSH and execute the following commands.
sudo apt update # Refresh the software source
sudo apt install git redis
Then install node.js. Remember not to install it directly using apt because the version built into apt is too old.
Here, I installed version v18.15.0-lts, but you can install a different version if you want.
# Download and extract the installation package
wget https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/v18.15.0/node-v18.15.0-linux-x64.tar.gz
tar zxvf node-v18.15.0-linux-x64.tar.gz
# Copy to /usr/local
sudo mkdir /usr/local/nodejs
sudo cp -r node-v18.15.0-linux-x64/* /usr/local/nodejs
# Create symbolic links
sudo ln -s /usr/local/nodejs/bin/node /usr/local/bin
sudo ln -s /usr/local/nodejs/bin/npm /usr/local/bin
# Delete temporary files
rm -rf node-v18.15.0-linux-x64
rm node-v18.15.0-linux-x64.tar.gz
Then, make sure that node.js is installed correctly.
$ node --version
v18.15.0
$ npm --version
9.5.0
Next, install pnpm.
sudo npm --registry=https://registry.npmmirror.com install pnpm -g
pnpm config set registry https://registry.npmmirror.com # Set the mainland mirror source
Installation and Execution#
- Clone the repository.
git clone --depth=1 https://gitee.com/yoimiya-kokomi/Miao-Yunzai.git
cd Miao-Yunzai
git clone --depth=1 https://gitee.com/yoimiya-kokomi/miao-plugin.git ./plugins/miao-plugin/
- Install dependencies.
pnpm install -P
This step may take some time, so please be patient and relax (lol).
- Run the application.
node app
Then, log in to your account according to the prompt.
Troubleshooting#
-
If you encounter the issue of puppeteer Chromium failing to start.
Try executing the following command.
sudo apt install libatk1.0-0 libatk-bridge2.0-0 libxdamage1 libgbm1 libxkbcommon-dev libpango-1.0-0 libcairo2
- Garbled characters in the generated image.
sudo apt install fontconfig xfonts-utils
Then, upload all the fonts in your computer's C:\Windows\Fonts
to /usr/share/fonts
.
Finally, update the font library.
sudo mkfontscale
sudo mkfontdir
References#
- yoimiya-kokomi/Miao-Yunzai: Miao version of Yunzai-V3 (github.com)
- Install Chinese Fonts on Linux - Invincible Cactus - Blog Garden (cnblogs.com)
This article is synchronized and updated to xLog by Mix Space.
The original link is https://bdovo.cc/posts/experiences/Install_Yunzai-bot