Those things about my secondary development of Yapi

Get into the habit of writing together! This is the 5th day of my participation in the "Nuggets Daily New Plan·April Update Challenge",Click to view event details

Those things about my secondary development of Yapi

To be honest, when I received this project, I was really full of confidence, isn't it just two openings? It's a small thing, after I develop it, I just want to sing silently小白菜啊。。。地里凉

Record the notes of stepping on the pit here, if. after. If you need to develop it! Just don't step on the pit

Install Yapi

1. Create a project directory

mkdir yapi && cd yapi
git clone https://github.com/YMFE/yapi.git vendors --depth=1 # 或者下载 zip 包解压到 vendors 目录
复制代码

First of all, there is a problem here, git clone fails. . . . emmmm

The reported git出现RPC failed; [curl](https://so.csdn.net/so/search?q=curl&spm=1001.2101.3001.7020) 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errfno 10054problem, as shown in the screenshot below

image.png

  • Workaround - reference address
    1. git config http.sslVerify "false"
    2. If you enter the above command prompt and report " fatal: not in a git directory ", enter the following command: git init
    3. Redownload the code: git clone xxxx
    4. If the git code still fails to download, you need to modify the size of the git cache to 100MB and enter the following command: git config --global http.postBuffer 100M

2. Modify the configuration

cp vendors/config_example.json ./config.json # 复制完成后请修改相关配置
vi ./config.json
复制代码

I encountered a little problem here 'cp' 不是内部或外部命令,也不是可运行的程序, this is relatively simple, don't use cmd, just use powershell

3. Install dependencies

cd vendors
npm install  --registry https://registry.npm.taobao.org # 安装依赖
复制代码

There will be a series of error reference documents here:If there is a problem with YApi installation, please see hereI thought it would work. . . . Press with confidence

npm run dev
复制代码

image.pngGod it's so hard!

I found it when I was searching hard in the yapi project on githubInstallation failed, Cannot find module 'fs-extra' #458issues

image.pngWith the attitude of treating a dead horse as a living horse doctor, I choose to execute the following command

cnpm i
npm run dev
复制代码

image.pngagain and again. . . .

ceeb653ely1gam2j9ym3tg20dc0cmab5.gif

This problem is relatively simple, it is the problem of mongodb, open it to install the configuration content of config.json and configure it

About the white screen problem

image.pngRegarding the white screen problem, the dependencies may not be installed

node-gyp

I remembered that we installed node-gypthis dependency package and depended on the c++file, so we need toInstallation ManualFind the corresponding environment to install

in package.json

npm run dev-copy-icon && ykit s -p 4000复制代码

ykit has to be installed

 npm install ykit -g
复制代码

After the installation is still a white screen, you can run this command in another windownpm run dev-copy-icon && ykit s -p 4000

Guess you like

Origin juejin.im/post/7084207448155750430