YApi環境配置過程

2022-06-15 08:18:11 字數 2557 閱讀 4948

yapi 乙個視覺化介面管理工具

部署前準備:

伺服器環境 centos7, ip位址 192.168.1.18

node.js

mongodb

nodejs

123

4567

89

wget  

tar -zxvf node-v10.15.1-linux-x64.tar.gz

mkdir /usr/local/nodejs

mv node-v10.15.1-linux-x64/* /usr/local/nodejs

rm -rf node-v10.15.1-linux-x64

ln -s /usr/local/nodejs/bin/node /usr/local/bin

ln -s /usr/local/nodejs/bin/npm /usr/local/bin

mongodb

123

4567

891011

1213

1415

1617

1819

2021

2223

2425

2627

2829

3031

3233

3435

3637

3839

yapi 安裝

123

4567

891011

1213

1415

1617

1819

20

問題

123

4567

891011

1213

1415

1617

1819

2021

2223

2425

2627

2829

3031

3233

3435

3637

3839

4041

42

#第一種安裝方式的相關問題

#1.依賴庫安裝完成,正在初始化資料庫mongodb...

error: internal/modules/cjs/loader.js:583 throw err; ^ error: cannot find module 'sha1' at function.module._

#解決:編輯 /usr/local/nodejs/lib/node_modules/yapi-cli/src/commands/install.js, 找到 handlenpminstall()

將 npm install -q --production --registry

修改為 yarn install -q --production --registry

#2.

依賴庫安裝完成,正在初始化資料庫mongodb...

error: (node:9716) unhandledpromiserejectionwarning: mongoerror: command insert requires authentication

#解決:需配置 mongo 資料庫認證, 配置使用者名稱和密碼即可

#第二種安裝方式的相關問題

#1. npm install --production --registry

npm err! path /data/wwwroot/private/yapi/vendors/node_modules/assert-plus/package.json.1991383012

npm err! code etxtbsy

npm err! errno -26

npm err! syscall rename

npm err! etxtbsy: text file is busy, rename '/data/wwwroot/private/yapi/vendors/node_modules/assert-plus/package.json.1991383012' -> '/data/wwwroot/private/yapi/vendors/node_modules/assert-plus/package.json'

npm err! a complete log of this run can be found in:

npm err! /root/.npm/_logs/2019-02-20t06_05_59_862z-debug.log

#解決npm install -g yarn

ln -s /usr/local/nodejs/bin/yarn /usr/local/bin/

yarn install --production --registry

#2. npm run install-server

error: mongoerror: authentication failed., mongodb authentication failed

#解決:配置 config.json

}

Yapi 1yapi環境搭建

在專案開發的過程中 資料 後端 介面 前端被分成三個人在負責。出於現狀考慮作罷。上家公司用的yapi感覺還不錯,於是決定自己搭建api管理平台。一 安裝node。二 安裝git 三 安裝mongodb 安裝 注意安裝時提示關閉硬衝程式選下面那個不然電腦會黑屏很長時間。安裝時間可能比較久我電腦黑屏很長...

記錄安裝配置Yapi的過程

參考 系統 centos7.4 安裝nodejs 獲取資源 部署nodejs盡可能選擇偶數版本,因為偶數版本官方有較長的維護時間,故這次選擇8.x。curl sl bash 安裝yum install y nodejs 檢視版本 node v 檢視npm版本 npm v 安裝mongodb 更新yu...

linux配置環境的過程

拿到一台伺服器,需要配置環境,如果伺服器有gpu,可以使用nvidia smi檢視gpu資訊,但如果沒有這個命令,可能要安裝驅動 安裝anaconda,見部落格 檢視pip,有些伺服器是自帶python2.7的,並且path usr bin裡面自帶pip 這裡的pip是python2的 新安裝的an...