Error: (node:25825) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[root@ebs-40617 vendors]# node server/install.js log: mongodb load success... (node:25848) UnhandledPromiseRejectionWarning: Error: 初始化管理员账号 "admin@it.com" 失败, E11000 duplicate key error collection: yapi.user index: email_1 dup key: { email: "admin@it.com" } at /home/my-yapi/vendors/server/install.js:146:17 at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:25848) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:25848) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
解决: mongo --port 27017 -u "root" --authenticationDatabase "admin" -p Rookie123$ use yapi switched to db yapi db.user.remove({'username':'admin'}) WriteResult({ "nRemoved" : 1 }) 接着来: node server/install.js
ExecStart=/usr/nodejs/lib/node_modules/pm2/bin/pm2 resurrect ExecReload=/usr/nodejs/lib/node_modules/pm2/bin/pm2 reload all ExecStop=/usr/nodejs/lib/node_modules/pm2/bin/pm2 kill
[Install] WantedBy=multi-user.target
Target path /etc/systemd/system/pm2-root.service Command list [ 'systemctl enable pm2-root' ] [PM2] Writing init configuration in /etc/systemd/system/pm2-root.service [PM2] Making script booting at startup... [PM2] [-] Executing: systemctl enable pm2-root... Created symlink from /etc/systemd/system/multi-user.target.wants/pm2-root.service to /etc/systemd/system/pm2-root.service. [PM2] [v] Command successfully executed. +---------------------------------------+ [PM2] Freeze a process list on reboot via: $ pm2 save
[error] ./client/components/CaseEnv/index.scss Module build failed: Error: Missing binding /home/my-yapi/vendors/node_modules/node-sass/vendor/linux-x64-79/binding.node Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 13.x
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration . [error] ./client/components/Loading/Loading.js
/home/my-yapi2/vendors/client/components/Loading/Loading.js 16:3 error componentWillReceiveProps is deprecated since React 16.9.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops. Use https://github.com/reactjs/react-codemod#rename-unsafe-lifecycles to automatically update your components react/no-deprecated