yapi安裝部署


1.安裝nodejs 7.6+

2. 安裝mongodb

>mongod --config F:\mongodb\conf\mongodb.conf

3. 安裝yapi


D:\yapi>npm install -g yapi-cli --registry https://registry.npm.taobao.org
C:\Users\14218\AppData\Roaming\npm\yapi -> C:\Users\14218\AppData\Roaming\npm\node_modules\yapi-cli\bin\yapi-cli
C:\Users\14218\AppData\Roaming\npm\yapi-cli -> C:\Users\14218\AppData\Roaming\npm\node_modules\yapi-cli\bin\yapi-cli
+ yapi-cli@1.5.0
added 266 packages from 125 contributors in 29.525s

D:\yapi>

 

依賴庫安裝完成,正在初始化數據庫mongodb...
> yapi-vendor@1.9.2 install-server D:\yapi\my-yapi\vendors > node server/install.js
log: mongodb load success...
初始化管理員賬號成功,賬號名:"748879874@qq.com",密碼:"ymfe.org"
部署成功,請切換到部署目錄,輸入: "node vendors/server/app.js" 指令啟動服務器, 然后在瀏覽器打開 http://127.0.0.1:3000 訪問


當前安裝版本: 1.9.2
連接數據庫成功!
開始下載平台文件壓縮包...
http://registry.npm.taobao.org/yapi-vendor/download/yapi-vendor-1.9.2.tgz
部署文件完成,正在安裝依賴庫...
npm
WARN deprecated babel@6.23.0: In 6.x, the babel package has been deprecated in favor of babel-cli. Check https://opencollective.com/babel to support the Babel maintainers
npm WARN deprecated
babel-preset-es2015@6.24.1: ???? Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated extract-text-webpack-plugin@2.0.0: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated validate-commit-msg@2.14.0: Check out CommitLint which provides the same functionality with a more user-focused experience.
npm
WARN deprecated koa-multer@1.0.2: Please use @koa/multer instead, see <https://github.com/koajs/multer>
npm WARN
deprecated request@2.81.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN
deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated extract-text-webpack-plugin@2.1.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
npm
WARN deprecated fsevents@1.1.2: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm
WARN deprecated extract-text-webpack-plugin@1.0.1: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
npm WARN
deprecated babel-preset-es2017@6.24.1: ???? Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated joi@6.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN
deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated sw-precache@5.2.1: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
npm WARN deprecated
ejs@2.3.4: Critical security bugs fixed in 2.5.5
npm WARN deprecated
mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN
deprecated topo@1.1.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated
sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN
deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN
deprecated sw-toolbox@3.6.0: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
npm WARN deprecated
core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated json3@3.3.2: Please use the native JSON object instead of JSON 3
> dtrace-provider@0.8.8 install D:\yapi\my-yapi\vendors\node_modules\dtrace-provider > node-gyp rebuild || node suppress-error.js

D:\yapi\my-yapi\vendors\node_modules\dtrace-provider>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp
ERR! configure error gyp ERR! stack Error: Command failed: D:\python\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "<string>", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack ^ gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12) gyp ERR! stack at ChildProcess.emit (events.js:189:13) gyp ERR! stack at maybeClose (internal/child_process.js:970:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) gyp ERR! System Windows_NT 10.0.18363 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd D:\yapi\my-yapi\vendors\node_modules\dtrace-provider gyp ERR!
node -v v10.15.3 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok
> core-js@2.6.11 postinstall D:\yapi\my-yapi\vendors\node_modules\core-js > node -e "try{require('./postinstall')}catch(e){}"
npm WARN mongoose-auto-increment@5.0.1 requires a peer of mongoose@^4.1.12 but none is installed. You must install peer dependencies yourself. npm WARN
markdown-it-include@1.1.1 requires a peer of markdown-it@>=8.4.2 <11.0.0 but none is installed. You must install peer dependencies yourself. npm WARN sass-loader@7.3.1 requires a peer of webpack@^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN react-slick@0.15.4 requires a peer of react@^0.14.0 || ^15.0.1 but none is installed. You must install peer dependencies yourself. npm WARN react-slick@0.15.4 requires a peer of react-dom@^0.14.0 || ^15.0.1 but none is installed. You must install peer dependencies yourself. npm WARN slick-carousel@1.8.1 requires a peer of jquery@>=1.8.0 but none is installed. You must install peer dependencies yourself. added 332 packages from 331 contributors in 45.089s
依賴庫安裝完成,正在初始化數據庫mongodb...
> yapi-vendor@1.9.2 install-server D:\yapi\my-yapi\vendors > node server/install.js
log: mongodb load success...
初始化管理員賬號成功,賬號名:"748.....@qq.com",密碼:"ymfe.org"
部署成功,請切換到部署目錄,輸入: "node vendors/server/app.js" 指令啟動服務器, 然后在瀏覽器打開 http://127.0.0.1:3000 訪問

 

4. 啟動yapi.

D:\yapi>cd my-yapi

D:\yapi\my-yapi>node vendors/server/app.js
log: -------------------------------------swaggerSyncUtils constructor-----------------------------------------------
log: 服務已啟動,請打開下面鏈接訪問:
http://127.0.0.1:3000/
log: mongodb load success...

(node:3460) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
(node:3460) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
D:\yapi>cd my-yapi

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM